[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 15:27:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f8ce5158fb39e0d70d5e4ebfc8c2af438d5a3aca
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 3 21:54:17 2010 +0000

    Implement NP_SetProperty
    https://bugs.webkit.org/show_bug.cgi?id=48956
    
    Reviewed by Adam Roben.
    
    WebKit2:
    
    * Shared/Plugins/NPObjectMessageReceiver.cpp:
    (WebKit::NPObjectMessageReceiver::setProperty):
    Call the NPClass setProperty function.
    
    * Shared/Plugins/NPObjectMessageReceiver.messages.in:
    Add SetProperty message.
    
    * Shared/Plugins/NPObjectProxy.cpp:
    (WebKit::NPObjectProxy::setProperty):
    Send a SetProperty message.
    
    (WebKit::NPObjectProxy::NP_SetProperty):
    Call NPObjectProxy::setProperty.
    
    LayoutTests:
    
    Remove now passing test.
    
    * platform/mac-wk2/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71273 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2143e81..594b266 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-03  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Implement NP_SetProperty
+        https://bugs.webkit.org/show_bug.cgi?id=48956
+
+        Remove now passing test.
+
+        * platform/mac-wk2/Skipped:
+
 2010-11-03  Matthew Delaney  <mdelaney at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 99b7c48..2c6b2be 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1746,7 +1746,6 @@ plugins/npruntime/npruntime.html
 plugins/npruntime/object-from-destroyed-plugin.html
 plugins/npruntime/plugin-scriptable-object-invoke-default.html
 plugins/npruntime/round-trip-npobject.html
-plugins/npruntime/set-property.html
  
 ########################################
 
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index ebfe94d..03e601a 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,26 @@
 2010-11-03  Anders Carlsson  <andersca at apple.com>
 
+        Reviewed by Adam Roben.
+
+        Implement NP_SetProperty
+        https://bugs.webkit.org/show_bug.cgi?id=48956
+
+        * Shared/Plugins/NPObjectMessageReceiver.cpp:
+        (WebKit::NPObjectMessageReceiver::setProperty):
+        Call the NPClass setProperty function.
+
+        * Shared/Plugins/NPObjectMessageReceiver.messages.in:
+        Add SetProperty message.
+
+        * Shared/Plugins/NPObjectProxy.cpp:
+        (WebKit::NPObjectProxy::setProperty):
+        Send a SetProperty message.
+
+        (WebKit::NPObjectProxy::NP_SetProperty):
+        Call NPObjectProxy::setProperty.
+
+2010-11-03  Anders Carlsson  <andersca at apple.com>
+
         Reviewed by Simon Fraser.
 
         Out of process plug-ins don't support the CA drawing model
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
index a37aad9..9a9e9ac 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
@@ -126,6 +126,22 @@ void NPObjectMessageReceiver::getProperty(const NPIdentifierData& propertyNameDa
     releaseNPVariantValue(&result);
 }
 
+void NPObjectMessageReceiver::setProperty(const NPIdentifierData& propertyNameData, const NPVariantData& propertyValueData, bool& returnValue)
+{
+    if (!m_npObject->_class->setProperty) {
+        returnValue = false;
+        return;
+    }
+
+    NPVariant propertyValue = m_npRemoteObjectMap->npVariantDataToNPVariant(propertyValueData);
+
+    // Set the property.
+    returnValue = m_npObject->_class->setProperty(m_npObject, propertyNameData.createNPIdentifier(), &propertyValue);
+
+    // And release the value.
+    releaseNPVariantValue(&propertyValue);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
index c366206..22db42e 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
@@ -57,6 +57,7 @@ private:
     void invoke(const NPIdentifierData&, const Vector<NPVariantData>& argumentsData, bool& returnValue, NPVariantData& resultData);
     void hasProperty(const NPIdentifierData&, bool& returnValue);
     void getProperty(const NPIdentifierData&, bool& returnValue, NPVariantData& resultData);
+    void setProperty(const NPIdentifierData&, const NPVariantData& propertyValueData, bool& returnValue);
 
     NPRemoteObjectMap* m_npRemoteObjectMap;
     uint64_t m_npObjectID;
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
index 60744c3..0b1ad89 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
@@ -28,6 +28,7 @@ messages -> NPObjectMessageReceiver {
     Invoke(WebKit::NPIdentifierData methodName, Vector<WebKit::NPVariantData> argumentsData) -> (bool returnValue, WebKit::NPVariantData resultData)
     HasProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
     GetProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue, WebKit::NPVariantData resultData)
+    SetProperty(WebKit::NPIdentifierData propertyName, WebKit::NPVariantData propertyValueData) -> (bool returnValue)
 }
 
 #endif
diff --git a/WebKit2/Shared/Plugins/NPObjectProxy.cpp b/WebKit2/Shared/Plugins/NPObjectProxy.cpp
index 9619a86..26abe82 100644
--- a/WebKit2/Shared/Plugins/NPObjectProxy.cpp
+++ b/WebKit2/Shared/Plugins/NPObjectProxy.cpp
@@ -158,6 +158,22 @@ bool NPObjectProxy::getProperty(NPIdentifier propertyName, NPVariant* result)
     return true;
 }
 
+bool NPObjectProxy::setProperty(NPIdentifier propertyName, const NPVariant* value)
+{
+    if (!m_npRemoteObjectMap)
+        return false;
+    
+    NPIdentifierData propertyNameData = NPIdentifierData::fromNPIdentifier(propertyName);
+    NPVariantData propertyValueData = m_npRemoteObjectMap->npVariantToNPVariantData(*value);
+
+    bool returnValue = false;
+
+    if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::SetProperty(propertyNameData, propertyValueData), Messages::NPObjectMessageReceiver::SetProperty::Reply(returnValue), m_npObjectID))
+        return false;
+
+    return returnValue;
+}
+
 NPClass* NPObjectProxy::npClass()
 {
     static NPClass npClass = {
@@ -218,10 +234,9 @@ bool NPObjectProxy::NP_GetProperty(NPObject* npObject, NPIdentifier propertyName
     return toNPObjectProxy(npObject)->getProperty(propertyName, result);
 }
 
-bool NPObjectProxy::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value)
+bool NPObjectProxy::NP_SetProperty(NPObject* npObject, NPIdentifier propertyName, const NPVariant* value)
 {
-    notImplemented();
-    return false;
+    return toNPObjectProxy(npObject)->setProperty(propertyName, value);
 }
 
 bool NPObjectProxy::NP_RemoveProperty(NPObject*, NPIdentifier propertyName)
diff --git a/WebKit2/Shared/Plugins/NPObjectProxy.h b/WebKit2/Shared/Plugins/NPObjectProxy.h
index 2156f80..485d3ee 100644
--- a/WebKit2/Shared/Plugins/NPObjectProxy.h
+++ b/WebKit2/Shared/Plugins/NPObjectProxy.h
@@ -61,6 +61,7 @@ private:
     bool invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
     bool hasProperty(NPIdentifier propertyName);
     bool getProperty(NPIdentifier propertyName, NPVariant* result);
+    bool setProperty(NPIdentifier propertyName, const NPVariant* value);
 
     static NPClass* npClass();
     static NPObject* NP_Allocate(NPP, NPClass*);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list