Title: [200950] trunk/Source/WebKit2
Revision
200950
Author
[email protected]
Date
2016-05-16 11:09:46 -0700 (Mon, 16 May 2016)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (200949 => 200950)


--- trunk/Source/WebKit2/ChangeLog	2016-05-16 18:04:25 UTC (rev 200949)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-16 18:09:46 UTC (rev 200950)
@@ -1,3 +1,24 @@
+2016-05-16  Brian Burg  <[email protected]>
+
+        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):
+
 2016-05-13  Dean Jackson  <[email protected]>
 
         Fix iOS Build.

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (200949 => 200950)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2016-05-16 18:04:25 UTC (rev 200949)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2016-05-16 18:09:46 UTC (rev 200950)
@@ -1579,7 +1579,9 @@
 
     webPage->injectedBundleLoaderClient().didClearWindowObjectForFrame(webPage, m_frame, world);
 
-    if (auto automationSessionProxy = WebProcess::singleton().automationSessionProxy())
+
+    WebAutomationSessionProxy* automationSessionProxy = WebProcess::singleton().automationSessionProxy();
+    if (automationSessionProxy && world.isNormal())
         automationSessionProxy->didClearWindowObjectForFrame(*m_frame);
 
 #if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to