Changeset 200950 in webkit


Ignore:
Timestamp:
May 16, 2016 11:09:46 AM (8 years ago)
Author:
BJ Burg
Message:

Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
https://bugs.webkit.org/show_bug.cgi?id=157716
<rdar://problem/26287306>

Reviewed by Timothy Hatcher.

Whenever a script was injected into a non-normal world by a WebKit client,
the WebProcess's WebAutomationSessionProxy singleton would get a
notification that the window was cleared from the relevant frame.
This notification happens when creating the world's window shell for
the first time.

This code should ignore such notifications that originate from non-main world
contexts. Web Inspector's instrumentation already ignored this, but
the automation session notification comes in via a different WebKit2 layer.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r200912 r200950  
     12016-05-16  Brian Burg  <bburg@apple.com>
     2
     3        Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
     4        https://bugs.webkit.org/show_bug.cgi?id=157716
     5        <rdar://problem/26287306>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        Whenever a script was injected into a non-normal world by a WebKit client,
     10        the WebProcess's WebAutomationSessionProxy singleton would get a
     11        notification that the window was cleared from the relevant frame.
     12        This notification happens when creating the world's window shell for
     13        the first time.
     14
     15        This code should ignore such notifications that originate from non-main world
     16        contexts. Web Inspector's instrumentation already ignored this, but
     17        the automation session notification comes in via a different WebKit2 layer.
     18
     19        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     20        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
     21
    1222016-05-13  Dean Jackson  <dino@apple.com>
    223
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r200770 r200950  
    15801580    webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);
    15811581
    1582     if (auto automationSessionProxy = WebProcess::singleton().automationSessionProxy())
     1582
     1583    WebAutomationSessionProxy* automationSessionProxy = WebProcess::singleton().automationSessionProxy();
     1584    if (automationSessionProxy && world.isNormal())
    15831585        automationSessionProxy->didClearWindowObjectForFrame(*m_frame);
    15841586
Note: See TracChangeset for help on using the changeset viewer.