[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

ap at apple.com ap at apple.com
Fri Feb 26 22:14:58 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 447bbcff0c0640b3b8a67dc866dc2a509f403bc0
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 8 23:27:19 2010 +0000

            Reviewed by Darin Adler.
    
            https://bugs.webkit.org/show_bug.cgi?id=34727
            Assertion crashes and freezes when plug-in property access results in an exception
    
            Test: plugins/netscape-plugin-property-access-exception.html
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54516 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index fbb335a..c83aded 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
 2010-02-08  Alexey Proskuryakov  <ap at apple.com>
 
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34727
+        Assertion crashes and freezes when plug-in property access results in an exception
+
+        * plugins/netscape-plugin-property-access-exception-expected.txt: Added.
+        * plugins/netscape-plugin-property-access-exception.html: Added.
+        The test expectations are a compromise between common sense and Firefox behavior.
+
+        * platform/mac-snowleopard/Skipped: In OOP case, this test needs newer Safari.
+
+2010-02-08  Alexey Proskuryakov  <ap at apple.com>
+
         Put the test back on skipped list - it needs a newer version of Safari to pass.
 
         * platform/mac-snowleopard/Skipped:
diff --git a/LayoutTests/platform/mac-snowleopard/Skipped b/LayoutTests/platform/mac-snowleopard/Skipped
index 2c98bc4..3d9734a 100644
--- a/LayoutTests/platform/mac-snowleopard/Skipped
+++ b/LayoutTests/platform/mac-snowleopard/Skipped
@@ -8,6 +8,7 @@ plugins/mouse-events.html
 
 # These need a newer version of Safari.
 plugins/private-browsing-mode.html
+plugins/netscape-plugin-property-access-exception.html
 plugins/netscape-throw-exception.html
 
 # Radar bugs needed for these
diff --git a/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt b/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt
new file mode 100644
index 0000000..61fc0ee
--- /dev/null
+++ b/LayoutTests/plugins/netscape-plugin-property-access-exception-expected.txt
@@ -0,0 +1,8 @@
+
+SUCCESS: Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+SUCCESS: Exception caught: Error: plugin object testThrowExceptionProperty SUCCESS
+One could expect exceptions to be raised in the below cases, too - but Firefox doesn't do that in most of these (I do get an exception in the first case, but that's inconsistent with not getting it in the seconfd one).
+No exception caught on getting via testCallback.
+No exception caught on setting via testCallback.
+No exception caught on getting via testGetBrowserProperty.
+No exception caught on setting via testSetBrowserProperty.
diff --git a/LayoutTests/plugins/netscape-plugin-property-access-exception.html b/LayoutTests/plugins/netscape-plugin-property-access-exception.html
new file mode 100644
index 0000000..9102890
--- /dev/null
+++ b/LayoutTests/plugins/netscape-plugin-property-access-exception.html
@@ -0,0 +1,71 @@
+<html><body>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+<div id="getter">FAILURE: No exception caught on getting.</div>
+<div id="setter">FAILURE: No exception caught on setting.</div>
+<em>One could expect exceptions to be raised in the below cases, too - but Firefox doesn't
+do that in most of these (I do get an exception in the first case, but that's inconsistent with not
+getting it in the seconfd one).</em>
+<div id="getter2">No exception caught on getting via testCallback.</div>
+<div id="setter2">No exception caught on setting via testCallback.</div>
+<div id="getter3">No exception caught on getting via testGetBrowserProperty.</div>
+<div id="setter3">No exception caught on setting via testSetBrowserProperty.</div>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var plg = document.getElementsByName("plg")[0];
+
+    // Firefox sometimes behaves inconsistently, leaving an exception dangling until the next call.
+    function sanityCheckExceptionState(logTarget)
+    {
+        try {
+            plg.testEvaluate("");
+        } catch (e) {
+            document.getElementById(logTarget).innerHTML += " Huh? Exception raised later!";
+        }
+    }
+
+    try {
+        plg.testThrowExceptionProperty;
+    } catch (e) {
+        document.getElementById('getter').innerHTML = 'SUCCESS: Exception caught: ' + e;
+    }
+    sanityCheckExceptionState("getter");
+
+    try {
+        plg.testThrowExceptionProperty = "";
+    } catch (e) {
+        document.getElementById('setter').innerHTML = 'SUCCESS: Exception caught: ' + e;
+    }
+    sanityCheckExceptionState("setter");
+
+    try {
+        plg.testEvaluate("plg.testThrowExceptionProperty");
+    } catch (e) {
+        document.getElementById('getter2').innerHTML = 'Exception caught: ' + e;
+    }
+    sanityCheckExceptionState("getter2");
+
+    try {
+        plg.testEvaluate("plg.testThrowExceptionProperty = 0");
+    } catch (e) {
+        document.getElementById('setter2').innerHTML = 'Exception caught: ' + e;
+    }
+    sanityCheckExceptionState("setter2");
+
+    try {
+        plg.testGetBrowserProperty(plg, "testThrowExceptionProperty");
+    } catch (e) {
+        document.getElementById('getter3').innerHTML = 'Exception caught: ' + e;
+    }
+    sanityCheckExceptionState("getter3");
+
+    try {
+        plg.testSetBrowserProperty(plg, "testThrowExceptionProperty", 0);
+    } catch (e) {
+        document.getElementById('setter3').innerHTML = 'Exception caught: ' + e;
+    }
+    sanityCheckExceptionState("setter3");
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8a8493d..f762905 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-08  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34727
+        Assertion crashes and freezes when plug-in property access results in an exception
+
+        Test: plugins/netscape-plugin-property-access-exception.html
+
+        * bridge/c/c_instance.h: Made moveGlobalExceptionToExecState public, since it also need to
+        be called from CField.
+
+        * bridge/c/c_runtime.cpp:
+        (JSC::Bindings::CField::valueFromInstance): Call moveGlobalExceptionToExecState(). Without
+        this, not only didn't we get exceptions, but we also got an assertion failure because of
+        dangling global exception on next call into plug-in.
+        (JSC::Bindings::CField::setValueToInstance): Ditto.
+
 2010-02-08  Dirk Schulze  <krit at webkit.org>
 
         Unreviewed build fix of ChromiumWin.
diff --git a/WebCore/bridge/c/c_instance.h b/WebCore/bridge/c/c_instance.h
index 7109582..5c071f9 100644
--- a/WebCore/bridge/c/c_instance.h
+++ b/WebCore/bridge/c/c_instance.h
@@ -50,6 +50,7 @@ public:
     }
 
     static void setGlobalException(JSC::UString exception);
+    static void moveGlobalExceptionToExecState(ExecState* exec);
 
     ~CInstance ();
 
@@ -74,7 +75,6 @@ public:
     NPObject *getObject() const { return _object; }
 
 private:
-    static void moveGlobalExceptionToExecState(ExecState* exec);
     CInstance(NPObject*, PassRefPtr<RootObject>);
 
     mutable CClass *_class;
diff --git a/WebCore/bridge/c/c_runtime.cpp b/WebCore/bridge/c/c_runtime.cpp
index e9a7bb6..e038cd4 100644
--- a/WebCore/bridge/c/c_runtime.cpp
+++ b/WebCore/bridge/c/c_runtime.cpp
@@ -49,6 +49,7 @@ JSValue CField::valueFromInstance(ExecState* exec, const Instance* inst) const
         {
             JSLock::DropAllLocks dropAllLocks(SilenceAssertionsOnly);
             result = obj->_class->getProperty(obj, _fieldIdentifier, &property);
+            CInstance::moveGlobalExceptionToExecState(exec);
         }
         if (result) {
             JSValue result = convertNPVariantToValue(exec, &property, instance->rootObject());
@@ -70,6 +71,7 @@ void CField::setValueToInstance(ExecState *exec, const Instance *inst, JSValue a
         {
             JSLock::DropAllLocks dropAllLocks(SilenceAssertionsOnly);
             obj->_class->setProperty(obj, _fieldIdentifier, &variant);
+            CInstance::moveGlobalExceptionToExecState(exec);
         }
 
         _NPN_ReleaseVariantValue(&variant);
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index ddf1dd8..1423e06 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,5 +1,30 @@
 2010-02-08  Alexey Proskuryakov  <ap at apple.com>
 
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34727
+        Assertion crashes and freezes when plug-in property access results in an exception
+
+        * Plugins/Hosted/WebKitPluginClient.defs: Made PCSetProperty and PCRemoveProperty async.
+        A plug-in can call back whil processing this call (e.g. for NPN_SetException), so we need
+        to listen for messages while waiting for reply.
+
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WKPCEvaluate): If there is no instance proxy, return KERN_FAILURE. This improves consistency
+        between method implementations, and leaves us with one less IPC call to make in failure case
+        (returning false with KERN_SUCCESS and returning KERN_FAILURE looks the same from plugin
+        host code).
+        (WKPCInvoke): Ditto.
+        (WKPCInvokeDefault): Ditto.
+        (WKPCGetProperty): Ditto.
+        (WKPCSetProperty): Send a reply once done.
+        (WKPCRemoveProperty): Ditto.
+        (WKPCHasProperty): If there is no instance proxy, return KERN_FAILURE.
+        (WKPCHasMethod): Ditto.
+        (WKPCEnumerate): Ditto.
+
+2010-02-08  Alexey Proskuryakov  <ap at apple.com>
+
         Reviewed by Anders Carlsson.
 
         <rdar://problem/6530010> OOP: Support NPN_SetException
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 537033f..c5beb07 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -569,10 +569,8 @@ kern_return_t WKPCEvaluate(mach_port_t clientPort, uint32_t pluginID, uint32_t r
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
 
     PluginDestroyDeferrer deferrer(instanceProxy);
     
@@ -626,18 +624,14 @@ kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t req
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
 
     PluginDestroyDeferrer deferrer(instanceProxy);
     
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
-    if (!IdentifierRep::isValid(identifier)) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!IdentifierRep::isValid(identifier))
+        return KERN_FAILURE;
 
     Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier);
 
@@ -662,10 +656,8 @@ kern_return_t WKPCInvokeDefault(mach_port_t clientPort, uint32_t pluginID, uint3
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
 
     PluginDestroyDeferrer deferrer(instanceProxy);
 
@@ -708,16 +700,12 @@ kern_return_t WKPCGetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
     
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
-    if (!IdentifierRep::isValid(identifier)) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!IdentifierRep::isValid(identifier))
+        return KERN_FAILURE;
     
     PluginDestroyDeferrer deferrer(instanceProxy);
 
@@ -738,7 +726,7 @@ kern_return_t WKPCGetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
     return KERN_SUCCESS;
 }
 
-kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t serverIdentifier, data_t valueData, mach_msg_type_number_t valueLength, boolean_t* returnValue)
+kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier, data_t valueData, mach_msg_type_number_t valueLength)
 {
     DataDeallocator deallocator(valueData, valueLength);
 
@@ -754,18 +742,21 @@ kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
 
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
     if (!IdentifierRep::isValid(identifier))
-        *returnValue = false;
-    
+        return KERN_FAILURE;
+
+    bool result;
     if (identifier->isString()) {
         Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier);        
-        *returnValue = instanceProxy->setProperty(objectID, propertyNameIdentifier, valueData, valueLength);
+        result = instanceProxy->setProperty(objectID, propertyNameIdentifier, valueData, valueLength);
     } else 
-        *returnValue = instanceProxy->setProperty(objectID, identifier->number(), valueData, valueLength);
-    
+        result = instanceProxy->setProperty(objectID, identifier->number(), valueData, valueLength);
+
+    _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, result);
+
     return KERN_SUCCESS;
 }
 
-kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t serverIdentifier, boolean_t* returnValue)
+kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier)
 {
     NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
     if (!hostProxy)
@@ -780,13 +771,16 @@ kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
     if (!IdentifierRep::isValid(identifier))
         return KERN_FAILURE;
-        
+
+    bool result;
     if (identifier->isString()) {
         Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier);        
-        *returnValue = instanceProxy->removeProperty(objectID, propertyNameIdentifier);
+        result = instanceProxy->removeProperty(objectID, propertyNameIdentifier);
     } else 
-        *returnValue = instanceProxy->removeProperty(objectID, identifier->number());
-    
+        result = instanceProxy->removeProperty(objectID, identifier->number());
+
+    _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, result);
+
     return KERN_SUCCESS;
 }
 
@@ -797,18 +791,14 @@ kern_return_t WKPCHasProperty(mach_port_t clientPort, uint32_t pluginID, uint32_
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanReply(hostProxy->port(), pluginID, requestID, false);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
     
     PluginDestroyDeferrer deferrer(instanceProxy);
 
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
-    if (!IdentifierRep::isValid(identifier)) {
-        _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false);
-        return KERN_SUCCESS;
-    }    
+    if (!IdentifierRep::isValid(identifier))
+        return KERN_FAILURE;
     
     boolean_t returnValue;
     if (identifier->isString()) {
@@ -829,18 +819,14 @@ kern_return_t WKPCHasMethod(mach_port_t clientPort, uint32_t pluginID, uint32_t
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanReply(hostProxy->port(), pluginID, requestID, false);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
     
     PluginDestroyDeferrer deferrer(instanceProxy);
 
     IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>(serverIdentifier);
-    if (!IdentifierRep::isValid(identifier)) {
-        _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false);
-        return KERN_SUCCESS;
-    }
+    if (!IdentifierRep::isValid(identifier))
+        return KERN_FAILURE;
     
     Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier);        
     boolean_t returnValue = instanceProxy->hasMethod(objectID, methodNameIdentifier);
@@ -881,10 +867,8 @@ kern_return_t WKPCEnumerate(mach_port_t clientPort, uint32_t pluginID, uint32_t
         return KERN_FAILURE;
     
     NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID);
-    if (!instanceProxy) {
-        _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0);
-        return KERN_SUCCESS;
-    }
+    if (!instanceProxy)
+        return KERN_FAILURE;
     
     data_t resultData = 0;
     mach_msg_type_number_t resultLength = 0;
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
index 579d52b..58a7996 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
@@ -149,18 +149,18 @@ simpleroutine PCGetProperty(clientPort :mach_port_t;
                             objectID :uint32_t;
                             propertyNameIdentifier :uint64_t);
 
-routine PCSetProperty(clientPort :mach_port_t;
+simpleroutine PCSetProperty(clientPort :mach_port_t;
                     pluginID :uint32_t;
+                    requestID :uint32_t;
                     objectID :uint32_t;
                     propertyNameIdentifier :uint64_t;
-                    value :data_t;
-                    out returnValue :boolean_t);
+                    value :data_t);
 
-routine PCRemoveProperty(clientPort :mach_port_t;
+simpleroutine PCRemoveProperty(clientPort :mach_port_t;
                        pluginID :uint32_t;
+                       requestID :uint32_t;
                        objectID :uint32_t;
-                       propertyNameIdentifier :uint64_t;
-                       out returnValue :boolean_t);
+                       propertyNameIdentifier :uint64_t);
 
 simpleroutine PCHasProperty(clientPort :mach_port_t;
                             pluginID :uint32_t;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 224b567..64fa0da 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-08  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34727
+        Assertion crashes and freezes when plug-in property access results in an exception
+
+        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+        (pluginGetProperty): Raise an exception when accessing a particular property.
+        (pluginSetProperty): Ditto.
+        (pluginInvoke): Added methods to get and set host object properties.
+
 2010-02-08  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
index fa8aed1..e69da73 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
@@ -133,6 +133,7 @@ enum {
     ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM,
     ID_PROPERTY_PRIVATE_BROWSING_ENABLED,
     ID_PROPERTY_CACHED_PRIVATE_BROWSING_ENABLED,
+    ID_PROPERTY_THROW_EXCEPTION_PROPERTY,
     NUM_PROPERTY_IDENTIFIERS
 };
 
@@ -146,6 +147,7 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
     "returnErrorFromNewStream",
     "privateBrowsingEnabled",
     "cachedPrivateBrowsingEnabled",
+    "testThrowExceptionProperty"
 };
 
 enum {
@@ -172,6 +174,8 @@ enum {
     ID_DESTROY_NULL_STREAM,
     ID_TEST_RELOAD_PLUGINS_NO_PAGES,
     ID_TEST_RELOAD_PLUGINS_AND_PAGES,
+    ID_TEST_GET_BROWSER_PROPERTY,
+    ID_TEST_SET_BROWSER_PROPERTY,
     NUM_METHOD_IDENTIFIERS
 };
 
@@ -199,7 +203,9 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
     "testFail",
     "destroyNullStream",
     "reloadPluginsNoPages",
-    "reloadPluginsAndPages"
+    "reloadPluginsAndPages",
+    "testGetBrowserProperty",
+    "testSetBrowserProperty"
 };
 
 static NPUTF8* createCStringFromNPVariant(const NPVariant* variant)
@@ -264,6 +270,9 @@ static bool pluginGetProperty(NPObject* obj, NPIdentifier name, NPVariant* resul
     } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_CACHED_PRIVATE_BROWSING_ENABLED]) {
         BOOLEAN_TO_NPVARIANT(plugin->cachedPrivateBrowsingMode, *result);
         return true;
+    } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
+        browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
+        return true;
     }
     return false;
 }
@@ -280,6 +289,9 @@ static bool pluginSetProperty(NPObject* obj, NPIdentifier name, const NPVariant*
     } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) {
         plugin->returnErrorFromNewStream = NPVARIANT_TO_BOOLEAN(*variant);
         return true;
+    } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
+        browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
+        return true;
     }
 
     return false;
@@ -789,6 +801,12 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a
     } else if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_AND_PAGES]) {
         browser->reloadplugins(true);
         return true;
+    } else if (name == pluginMethodIdentifiers[ID_TEST_GET_BROWSER_PROPERTY]) {
+        browser->getproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), result);
+        return true;
+    } else if (name == pluginMethodIdentifiers[ID_TEST_SET_BROWSER_PROPERTY]) {
+        browser->setproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), &args[2]);
+        return true;
     }
     
     return false;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list