Title: [181864] trunk
Revision
181864
Author
ander...@apple.com
Date
2015-03-23 13:34:52 -0700 (Mon, 23 Mar 2015)

Log Message

Source/WebKit2:
Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
https://bugs.webkit.org/show_bug.cgi?id=133692
rdar://problem/17255947

Reviewed by Alexey Proskuryakov.

Add plug-in destruction protectors around message receiver code that can call out to NPObjects or _javascript_
where we need the plug-in to stay around after the call.

* Shared/Plugins/NPObjectMessageReceiver.cpp:
(WebKit::NPObjectMessageReceiver::invoke):
(WebKit::NPObjectMessageReceiver::invokeDefault):
(WebKit::NPObjectMessageReceiver::getProperty):
(WebKit::NPObjectMessageReceiver::setProperty):
(WebKit::NPObjectMessageReceiver::construct):

LayoutTests:
Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again
https://bugs.webkit.org/show_bug.cgi?id=133692
rdar://problem/17255947

Reviewed by Alexey Proskuryakov.

* platform/mac-wk2/TestExpectations:
Unskip test.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (181863 => 181864)


--- trunk/LayoutTests/ChangeLog	2015-03-23 20:31:56 UTC (rev 181863)
+++ trunk/LayoutTests/ChangeLog	2015-03-23 20:34:52 UTC (rev 181864)
@@ -1,3 +1,14 @@
+2015-03-23  Anders Carlsson  <ander...@apple.com>
+
+        Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again
+        https://bugs.webkit.org/show_bug.cgi?id=133692
+        rdar://problem/17255947
+
+        Reviewed by Alexey Proskuryakov.
+
+        * platform/mac-wk2/TestExpectations:
+        Unskip test.
+
 2015-03-23  Alexey Proskuryakov  <a...@apple.com>
 
         accessibility/textarea-selected-text-range.html is flaky

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (181863 => 181864)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2015-03-23 20:31:56 UTC (rev 181863)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2015-03-23 20:34:52 UTC (rev 181864)
@@ -240,8 +240,6 @@
 # testRunner.setUseDeferredFrameLoading is not implemented.
 webkit.org/b/93980 http/tests/appcache/load-from-appcache-defer-resume-crash.html [ Skip ]
 
-webkit.org/b/133692 platform/mac-wk2/plugins/destroy-during-async-npp-new.html [ Skip ]
-
 webkit.org/b/136554 platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-nested-frame-scrollability.html [ Pass Failure ]
 webkit.org/b/139901 platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html [ Pass Failure ]
 

Modified: trunk/Source/WebKit2/ChangeLog (181863 => 181864)


--- trunk/Source/WebKit2/ChangeLog	2015-03-23 20:31:56 UTC (rev 181863)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-23 20:34:52 UTC (rev 181864)
@@ -1,5 +1,23 @@
 2015-03-23  Anders Carlsson  <ander...@apple.com>
 
+        Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
+        https://bugs.webkit.org/show_bug.cgi?id=133692
+        rdar://problem/17255947
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add plug-in destruction protectors around message receiver code that can call out to NPObjects or _javascript_
+        where we need the plug-in to stay around after the call.
+
+        * Shared/Plugins/NPObjectMessageReceiver.cpp:
+        (WebKit::NPObjectMessageReceiver::invoke):
+        (WebKit::NPObjectMessageReceiver::invokeDefault):
+        (WebKit::NPObjectMessageReceiver::getProperty):
+        (WebKit::NPObjectMessageReceiver::setProperty):
+        (WebKit::NPObjectMessageReceiver::construct):
+
+2015-03-23  Anders Carlsson  <ander...@apple.com>
+
         Put the WK_NULLABLE_SPECIFIER in the right place for block parameters
         https://bugs.webkit.org/show_bug.cgi?id=142975
         rdar://problem/19863930

Modified: trunk/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp (181863 => 181864)


--- trunk/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp	2015-03-23 20:31:56 UTC (rev 181863)
+++ trunk/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp	2015-03-23 20:34:52 UTC (rev 181864)
@@ -32,6 +32,8 @@
 #include "NPRemoteObjectMap.h"
 #include "NPRuntimeUtilities.h"
 #include "NPVariantData.h"
+#include "Plugin.h"
+#include "PluginController.h"
 
 namespace WebKit {
 
@@ -80,6 +82,8 @@
     NPVariant result;
     VOID_TO_NPVARIANT(result);
 
+    PluginController::PluginDestructionProtector protector(m_plugin->controller());
+
     returnValue = m_npObject->_class->invoke(m_npObject, methodNameData.createNPIdentifier(), arguments.data(), arguments.size(), &result);
     if (returnValue) {
         // Convert the NPVariant to an NPVariantData.
@@ -108,6 +112,8 @@
     NPVariant result;
     VOID_TO_NPVARIANT(result);
 
+    PluginController::PluginDestructionProtector protector(m_plugin->controller());
+
     returnValue = m_npObject->_class->invokeDefault(m_npObject, arguments.data(), arguments.size(), &result);
     if (returnValue) {
         // Convert the NPVariant to an NPVariantData.
@@ -142,14 +148,15 @@
     NPVariant result;
     VOID_TO_NPVARIANT(result);
 
+    PluginController::PluginDestructionProtector protector(m_plugin->controller());
+
     returnValue = m_npObject->_class->getProperty(m_npObject, propertyNameData.createNPIdentifier(), &result);
     if (!returnValue)
         return;
 
-    // Convert the NPVariant to an NPVariantData.
+
     resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin);
 
-    // And release the result.
     releaseNPVariantValue(&result);
 }
 
@@ -162,10 +169,10 @@
 
     NPVariant propertyValue = m_npRemoteObjectMap->npVariantDataToNPVariant(propertyValueData, m_plugin);
 
-    // Set the property.
+    PluginController::PluginDestructionProtector protector(m_plugin->controller());
+
     returnValue = m_npObject->_class->setProperty(m_npObject, propertyNameData.createNPIdentifier(), &propertyValue);
 
-    // And release the value.
     releaseNPVariantValue(&propertyValue);
 }
 
@@ -213,17 +220,15 @@
     NPVariant result;
     VOID_TO_NPVARIANT(result);
 
+    PluginController::PluginDestructionProtector protector(m_plugin->controller());
+
     returnValue = m_npObject->_class->construct(m_npObject, arguments.data(), arguments.size(), &result);
-    if (returnValue) {
-        // Convert the NPVariant to an NPVariantData.
+    if (returnValue)
         resultData = m_npRemoteObjectMap->npVariantToNPVariantData(result, m_plugin);
-    }
 
-    // Release all arguments.
     for (size_t i = 0; i < argumentsData.size(); ++i)
         releaseNPVariantValue(&arguments[i]);
     
-    // And release the result.
     releaseNPVariantValue(&result);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to