web-threads: Create a single instance of WebThread for each blink thread.
commite2428d07b35723722cb9579ed6074d55bd858516
authorsadrul <sadrul@chromium.org>
Tue, 3 Mar 2015 18:45:08 +0000 (3 10:45 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 3 Mar 2015 18:46:22 +0000 (3 18:46 +0000)
tree9678f8bd32be85d7ac934eeee08044c54421be6a
parenta611afd29f0ee5bc8e77f5e037c9eb75b6707795
web-threads: Create a single instance of WebThread for each blink thread.

BlinkPlatformImpl currently creates an instance of WebThreadImpl when blink
creates a thread using 'createThread()'. When some code runs in the newly
created thread and tries to get hold of the WebThread that represents the
current thread using 'currentThread()', BlinkPlatformImpl creates a new
instance of a WebThreadImplForMessageLoop and returns that. For subsequent
calls to 'currentThread()', this same WebThreadImplForMessageLoop is
returned. So BlinkPlatformImpl ends up creating two WebThread instances
for each thread created in blink.

This patch changes this to only create a single instance of WebThread for
each thread created in blink. WebThreadImplForMessageLoop is no longer
necessary, so it is removed.

BUG=462067

Review URL: https://codereview.chromium.org/959803003

Cr-Commit-Position: refs/heads/master@{#318913}
content/child/blink_platform_impl.cc
content/child/blink_platform_impl.h
content/child/webthread_impl.cc
content/child/webthread_impl.h
content/test/test_blink_web_unit_test_support.cc
content/test/test_blink_web_unit_test_support.h