• sadrul's avatar
    web-threads: Create a single instance of WebThread for each blink thread. · e2428d07
    sadrul authored
    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}
    e2428d07
blink_platform_impl.h 8.02 KB