Title: [148483] trunk
Revision
148483
Author
ander...@apple.com
Date
2013-04-15 18:20:31 -0700 (Mon, 15 Apr 2013)

Log Message

Source/WebKit/mac: plugins/get-url-beforeunload-destroys-plugin.html crashes in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=114653
<rdar://problem/13659541>

Reviewed by Sam Weinig.

Protect the NetscapePluginInstanceProxy since it can otherwise go away.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::performRequest):

LayoutTests: plugins/get-url-beforeunload-destroys-plugin.html crashes in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=114653

Reviewed by Sam Weinig.

Move this test back now that it passes in WK1.

* http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt: Renamed from LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt.
* http/tests/plugins/get-url-beforeunload-destroys-plugin.html: Renamed from LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin.html.
* http/tests/plugins/resources/notify-done.html: Renamed from LayoutTests/platform/mac-wk2/http/tests/plugins/resources/notify-done.html.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (148482 => 148483)


--- trunk/LayoutTests/ChangeLog	2013-04-16 01:05:39 UTC (rev 148482)
+++ trunk/LayoutTests/ChangeLog	2013-04-16 01:20:31 UTC (rev 148483)
@@ -1,3 +1,16 @@
+2013-04-15  Anders Carlsson  <ander...@apple.com>
+
+        plugins/get-url-beforeunload-destroys-plugin.html crashes in WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=114653
+
+        Reviewed by Sam Weinig.
+
+        Move this test back now that it passes in WK1.
+
+        * http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt: Renamed from LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt.
+        * http/tests/plugins/get-url-beforeunload-destroys-plugin.html: Renamed from LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin.html.
+        * http/tests/plugins/resources/notify-done.html: Renamed from LayoutTests/platform/mac-wk2/http/tests/plugins/resources/notify-done.html.
+
 2013-04-15  Chris Fleizach  <cfleiz...@apple.com>
 
         activating a focused link to an in-page fragment ID should transfer focus to the target of the link when possible

Copied: trunk/LayoutTests/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt (from rev 148482, trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt) (0 => 148483)


--- trunk/LayoutTests/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt	2013-04-16 01:20:31 UTC (rev 148483)
@@ -0,0 +1 @@
+

Copied: trunk/LayoutTests/http/tests/plugins/get-url-beforeunload-destroys-plugin.html (from rev 148482, trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin.html) (0 => 148483)


--- trunk/LayoutTests/http/tests/plugins/get-url-beforeunload-destroys-plugin.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/plugins/get-url-beforeunload-destroys-plugin.html	2013-04-16 01:20:31 UTC (rev 148483)
@@ -0,0 +1,28 @@
+<html>
+<body _onbeforeunload_="accessPlugin()">
+This tests that NPN_GetURL causing the beforeunload event handler to destroy the plug-in doesn't crash.
+ 
+<object name="plg" type="application/x-webkit-test-netscape"></object>
+
+<script>
+    function accessPlugin()
+    {
+        var objects = document.getElementsByTagName("object");
+        for (var i = 0; i < objects.length; ++i) {
+            objects[i].style.display = "none";
+            for (var x in objects[i]) {
+                if (typeof objects[i][x] == "function")
+                    objects[i][x] = function() {};
+            }
+        }
+    }
+    
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
+
+    plg.getURL("resources/notify-done.html", "_self");
+</script>
+</body>
+</html>

Copied: trunk/LayoutTests/http/tests/plugins/resources/notify-done.html (from rev 148482, trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/resources/notify-done.html) (0 => 148483)


--- trunk/LayoutTests/http/tests/plugins/resources/notify-done.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/plugins/resources/notify-done.html	2013-04-16 01:20:31 UTC (rev 148483)
@@ -0,0 +1,4 @@
+<script>
+    if (window.testRunner)
+        testRunner.notifyDone();
+</script>

Deleted: trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt (148482 => 148483)


--- trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt	2013-04-16 01:05:39 UTC (rev 148482)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt	2013-04-16 01:20:31 UTC (rev 148483)
@@ -1 +0,0 @@
-

Deleted: trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin.html (148482 => 148483)


--- trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin.html	2013-04-16 01:05:39 UTC (rev 148482)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/get-url-beforeunload-destroys-plugin.html	2013-04-16 01:20:31 UTC (rev 148483)
@@ -1,28 +0,0 @@
-<html>
-<body _onbeforeunload_="accessPlugin()">
-This tests that NPN_GetURL causing the beforeunload event handler to destroy the plug-in doesn't crash.
- 
-<object name="plg" type="application/x-webkit-test-netscape"></object>
-
-<script>
-    function accessPlugin()
-    {
-        var objects = document.getElementsByTagName("object");
-        for (var i = 0; i < objects.length; ++i) {
-            objects[i].style.display = "none";
-            for (var x in objects[i]) {
-                if (typeof objects[i][x] == "function")
-                    objects[i][x] = function() {};
-            }
-        }
-    }
-    
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-    plg.getURL("resources/notify-done.html", "_self");
-</script>
-</body>
-</html>

Deleted: trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/resources/notify-done.html (148482 => 148483)


--- trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/resources/notify-done.html	2013-04-16 01:05:39 UTC (rev 148482)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/plugins/resources/notify-done.html	2013-04-16 01:20:31 UTC (rev 148483)
@@ -1,4 +0,0 @@
-<script>
-    if (window.testRunner)
-        testRunner.notifyDone();
-</script>

Modified: trunk/Source/WebKit/mac/ChangeLog (148482 => 148483)


--- trunk/Source/WebKit/mac/ChangeLog	2013-04-16 01:05:39 UTC (rev 148482)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-04-16 01:20:31 UTC (rev 148483)
@@ -1,3 +1,16 @@
+2013-04-15  Anders Carlsson  <ander...@apple.com>
+
+        plugins/get-url-beforeunload-destroys-plugin.html crashes in WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=114653
+        <rdar://problem/13659541>
+
+        Reviewed by Sam Weinig.
+
+        Protect the NetscapePluginInstanceProxy since it can otherwise go away.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::performRequest):
+
 2013-04-14  Sam Weinig  <s...@webkit.org>
 
         Move Mac specific snapshotting code into its own file

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


--- trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm	2013-04-16 01:05:39 UTC (rev 148482)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm	2013-04-16 01:20:31 UTC (rev 148483)
@@ -621,6 +621,9 @@
 
 void NetscapePluginInstanceProxy::performRequest(PluginRequest* pluginRequest)
 {
+    // Loading the request can cause the instance proxy to go away, so protect it.
+    RefPtr<NetscapePluginInstanceProxy> protect(this);
+
     ASSERT(m_pluginView);
     
     NSURLRequest *request = pluginRequest->request();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to