Title: [93732] trunk
Revision
93732
Author
[email protected]
Date
2011-08-24 13:36:15 -0700 (Wed, 24 Aug 2011)

Log Message

        Plug-in tests are flaky on Mac
        https://bugs.webkit.org/show_bug.cgi?id=66822

        Reviewed by Anders Carlsson.

        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
        (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript):
        Protect objects that can be removed by a script.

        * WebView/WebFrame.mm:
        (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Ditto.
        (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): Ditto.
        Also fixed some nonsense code.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93731 => 93732)


--- trunk/LayoutTests/ChangeLog	2011-08-24 20:31:59 UTC (rev 93731)
+++ trunk/LayoutTests/ChangeLog	2011-08-24 20:36:15 UTC (rev 93732)
@@ -1,3 +1,12 @@
+2011-08-24  Alexey Proskuryakov  <[email protected]>
+
+        Plug-in tests are flaky on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=66822
+
+        Reviewed by Anders Carlsson.
+
+        * platform/wk2/Skipped: Removed a test that was already passing in WK2 (but flaky in WK1).
+
 2011-08-24  Alexandru Chiculita  <[email protected]>
 
         [CSSRegions] Fix Element::getBoundingClientRect and Element::getClientRects for content flow

Modified: trunk/LayoutTests/platform/wk2/Skipped (93731 => 93732)


--- trunk/LayoutTests/platform/wk2/Skipped	2011-08-24 20:31:59 UTC (rev 93731)
+++ trunk/LayoutTests/platform/wk2/Skipped	2011-08-24 20:36:15 UTC (rev 93732)
@@ -1503,7 +1503,6 @@
 plugins/netscape-plugin-setwindow-size.html
 plugins/nested-plugin-objects.html
 plugins/pass-different-npp-struct.html
-plugins/plugin-remove-subframe.html
 plugins/reentrant-update-widget-positions.html
 plugins/reloadplugins-no-pages.html
 plugins/return-negative-one-from-write.html

Modified: trunk/Source/WebKit/mac/ChangeLog (93731 => 93732)


--- trunk/Source/WebKit/mac/ChangeLog	2011-08-24 20:31:59 UTC (rev 93731)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-08-24 20:36:15 UTC (rev 93732)
@@ -1,3 +1,19 @@
+2011-08-24  Alexey Proskuryakov  <[email protected]>
+
+        Plug-in tests are flaky on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=66822
+
+        Reviewed by Anders Carlsson.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript):
+        Protect objects that can be removed by a script.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Ditto.
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): Ditto.
+        Also fixed some nonsense code.
+
 2011-08-23  Mark Hahnenberg  <[email protected]>
 
         Add checks to ensure allocation does not take place during initialization of GC-managed objects

Modified: trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (93731 => 93732)


--- trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm	2011-08-24 20:31:59 UTC (rev 93731)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm	2011-08-24 20:36:15 UTC (rev 93732)
@@ -691,7 +691,9 @@
     NSURL *URL = "" URL];
     NSString *JSString = [URL _webkit_scriptIfJavaScriptURL];
     ASSERT(JSString);
-    
+
+    RefPtr<NetscapePluginInstanceProxy> protect(this); // Executing arbitrary _javascript_ can destroy the proxy.
+
     NSString *result = [[m_pluginView webFrame] _stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:pluginRequest->allowPopups()];
     
     // Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop.

Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (93731 => 93732)


--- trunk/Source/WebKit/mac/WebView/WebFrame.mm	2011-08-24 20:31:59 UTC (rev 93731)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm	2011-08-24 20:36:15 UTC (rev 93732)
@@ -608,6 +608,7 @@
 - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture
 {
     ASSERT(_private->coreFrame->document());
+    RetainPtr<WebFrame> protect(self); // Executing arbitrary _javascript_ can destroy the frame.
     
     JSValue result = _private->coreFrame->script()->executeScript(string, forceUserGesture).jsValue();
 
@@ -1211,9 +1212,11 @@
     // Get the frame frome the global object we've settled on.
     Frame* frame = anyWorldGlobalObject->impl()->frame();
     ASSERT(frame->document());
+    RetainPtr<WebFrame> webFrame(kit(frame)); // Running arbitrary _javascript_ can destroy the frame.
+
     JSValue result = frame->script()->executeScriptInWorld(core(world), string, true).jsValue();
 
-    if (!frame) // In case the script removed our frame from the page.
+    if (!webFrame->_private->coreFrame) // In case the script removed our frame from the page.
         return @"";
 
     // This bizarre set of rules matches behavior from WebKit for Safari 2.0.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to