[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:31:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 46e6d372f4c4b5cd0fd58e13b788deedef74814c
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 5 17:38:40 2010 +0000

    Implement NP_RemoveProperty and NP_Enumerate
    https://bugs.webkit.org/show_bug.cgi?id=49046
    
    Reviewed by Oliver Hunt.
    
    WebKit2:
    
    * Shared/Plugins/NPObjectMessageReceiver.cpp:
    (WebKit::NPObjectMessageReceiver::removeProperty):
    Call the removeProperty NPClass function.
    
    (WebKit::NPObjectMessageReceiver::enumerate):
    Call the enumerate NPClass function.
    
    * Shared/Plugins/NPObjectMessageReceiver.messages.in:
    Add RemoveProperty and Enumerate messages.
    
    * Shared/Plugins/NPObjectProxy.cpp:
    (WebKit::NPObjectProxy::removeProperty):
    Send the RemoveProperty message.
    
    (WebKit::NPObjectProxy::enumerate):
    Send the Enumerate message.
    
    (WebKit::NPObjectProxy::NP_RemoveProperty):
    Call removeProperty.
    
    (WebKit::NPObjectProxy::NP_Enumerate):
    Call enumerate.
    
    LayoutTests:
    
    Remove now passing tests.
    
    * platform/mac-wk2/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71430 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 37e104d..4e94992 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-04  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Implement NP_RemoveProperty and NP_Enumerate
+        https://bugs.webkit.org/show_bug.cgi?id=49046
+
+        Remove now passing tests.
+
+        * platform/mac-wk2/Skipped:
+
 2010-11-05  Zhenyao Mo  <zmo at google.com>
 
         Unreviewed, update webgl test expectations.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 2c6b2be..12177d5 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1735,15 +1735,11 @@ plugins/return-negative-one-from-write.html
 plugins/set-status.html
 plugins/update-widgets-crash.html
 plugins/window-open.html
-plugins/npruntime/enumerate.html
 plugins/npruntime/evaluate.html
-plugins/npruntime/get-int-identifier-special-values.html
-plugins/npruntime/get-property-return-value.html
 plugins/npruntime/identifier-conversion.html
 plugins/npruntime/invoke-browserfuncs.html
 plugins/npruntime/invoke-default.html
 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
  
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index f9fe580..4ae9f9d 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,33 @@
+2010-11-04  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Implement NP_RemoveProperty and NP_Enumerate
+        https://bugs.webkit.org/show_bug.cgi?id=49046
+
+        * Shared/Plugins/NPObjectMessageReceiver.cpp:
+        (WebKit::NPObjectMessageReceiver::removeProperty):
+        Call the removeProperty NPClass function.
+
+        (WebKit::NPObjectMessageReceiver::enumerate):
+        Call the enumerate NPClass function.
+
+        * Shared/Plugins/NPObjectMessageReceiver.messages.in:
+        Add RemoveProperty and Enumerate messages.
+
+        * Shared/Plugins/NPObjectProxy.cpp:
+        (WebKit::NPObjectProxy::removeProperty):
+        Send the RemoveProperty message.
+
+        (WebKit::NPObjectProxy::enumerate):
+        Send the Enumerate message.
+
+        (WebKit::NPObjectProxy::NP_RemoveProperty):
+        Call removeProperty.
+
+        (WebKit::NPObjectProxy::NP_Enumerate):
+        Call enumerate.
+
 2010-11-05  Sam Weinig  <sam at webkit.org>
 
         Fix failing python tests.
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
index 9a9e9ac..c71d409 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp
@@ -142,6 +142,36 @@ void NPObjectMessageReceiver::setProperty(const NPIdentifierData& propertyNameDa
     releaseNPVariantValue(&propertyValue);
 }
 
+void NPObjectMessageReceiver::removeProperty(const NPIdentifierData& propertyNameData, bool& returnValue)
+{
+    if (!m_npObject->_class->removeProperty) {
+        returnValue = false;
+        return;
+    }
+
+    returnValue = m_npObject->_class->removeProperty(m_npObject, propertyNameData.createNPIdentifier());
+}
+
+void NPObjectMessageReceiver::enumerate(bool& returnValue, Vector<NPIdentifierData>& identifiersData)
+{
+    if (!NP_CLASS_STRUCT_VERSION_HAS_ENUM(m_npObject->_class) || !m_npObject->_class->enumerate) {
+        returnValue = false;
+        return;
+    }
+
+    NPIdentifier* identifiers = 0;
+    uint32_t identifierCount = 0;
+
+    returnValue = m_npObject->_class->enumerate(m_npObject, &identifiers, &identifierCount);
+    if (!returnValue)
+        return;
+
+    for (uint32_t i = 0; i < identifierCount; ++i)
+        identifiersData.append(NPIdentifierData::fromNPIdentifier(identifiers[i]));
+
+    npnMemFree(identifiers);
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(PLUGIN_PROCESS)
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
index 22db42e..1f5cd06 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h
@@ -58,6 +58,8 @@ private:
     void hasProperty(const NPIdentifierData&, bool& returnValue);
     void getProperty(const NPIdentifierData&, bool& returnValue, NPVariantData& resultData);
     void setProperty(const NPIdentifierData&, const NPVariantData& propertyValueData, bool& returnValue);
+    void removeProperty(const NPIdentifierData&, bool& returnValue);
+    void enumerate(bool& returnValue, Vector<NPIdentifierData>& identifiersData);
 
     NPRemoteObjectMap* m_npRemoteObjectMap;
     uint64_t m_npObjectID;
diff --git a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
index 0b1ad89..7b51b1d 100644
--- a/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
+++ b/WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in
@@ -29,6 +29,8 @@ messages -> NPObjectMessageReceiver {
     HasProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
     GetProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue, WebKit::NPVariantData resultData)
     SetProperty(WebKit::NPIdentifierData propertyName, WebKit::NPVariantData propertyValueData) -> (bool returnValue)
+    RemoveProperty(WebKit::NPIdentifierData propertyName) -> (bool returnValue)
+    Enumerate() -> (bool returnValue, Vector<WebKit::NPIdentifierData> identifiersData)
 }
 
 #endif
diff --git a/WebKit2/Shared/Plugins/NPObjectProxy.cpp b/WebKit2/Shared/Plugins/NPObjectProxy.cpp
index 26abe82..36ca01a 100644
--- a/WebKit2/Shared/Plugins/NPObjectProxy.cpp
+++ b/WebKit2/Shared/Plugins/NPObjectProxy.cpp
@@ -174,6 +174,45 @@ bool NPObjectProxy::setProperty(NPIdentifier propertyName, const NPVariant* valu
     return returnValue;
 }
 
+bool NPObjectProxy::removeProperty(NPIdentifier propertyName)
+{
+    if (!m_npRemoteObjectMap)
+        return false;
+    
+    NPIdentifierData propertyNameData = NPIdentifierData::fromNPIdentifier(propertyName);
+
+    bool returnValue = false;
+    
+    if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::RemoveProperty(propertyNameData), Messages::NPObjectMessageReceiver::RemoveProperty::Reply(returnValue), m_npObjectID))
+        return false;
+
+    return returnValue;
+}
+
+bool NPObjectProxy::enumerate(NPIdentifier** identifiers, uint32_t* identifierCount)
+{
+    if (!m_npRemoteObjectMap)
+        return false;
+
+    bool returnValue;
+    Vector<NPIdentifierData> identifiersData;
+
+    if (!m_npRemoteObjectMap->connection()->sendSync(Messages::NPObjectMessageReceiver::Enumerate(), Messages::NPObjectMessageReceiver::Enumerate::Reply(returnValue, identifiersData), m_npObjectID))
+        return false;
+
+    if (!returnValue)
+        return false;
+
+    NPIdentifier* nameIdentifiers = npnMemNewArray<NPIdentifier>(identifiersData.size());
+    
+    for (size_t i = 0; i < identifiersData.size(); ++i)
+        nameIdentifiers[i] = identifiersData[i].createNPIdentifier();
+    
+    *identifiers = nameIdentifiers;
+    *identifierCount = identifiersData.size();
+    return true;
+}
+
 NPClass* NPObjectProxy::npClass()
 {
     static NPClass npClass = {
@@ -239,16 +278,14 @@ bool NPObjectProxy::NP_SetProperty(NPObject* npObject, NPIdentifier propertyName
     return toNPObjectProxy(npObject)->setProperty(propertyName, value);
 }
 
-bool NPObjectProxy::NP_RemoveProperty(NPObject*, NPIdentifier propertyName)
+bool NPObjectProxy::NP_RemoveProperty(NPObject* npObject, NPIdentifier propertyName)
 {
-    notImplemented();
-    return false;
+    return toNPObjectProxy(npObject)->removeProperty(propertyName);
 }
 
-bool NPObjectProxy::NP_Enumerate(NPObject*, NPIdentifier** identifiers, uint32_t* identifierCount)
+bool NPObjectProxy::NP_Enumerate(NPObject* npObject, NPIdentifier** identifiers, uint32_t* identifierCount)
 {
-    notImplemented();
-    return false;
+    return toNPObjectProxy(npObject)->enumerate(identifiers, identifierCount);
 }
 
 bool NPObjectProxy::NP_Construct(NPObject*, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
diff --git a/WebKit2/Shared/Plugins/NPObjectProxy.h b/WebKit2/Shared/Plugins/NPObjectProxy.h
index 485d3ee..bc6cfb1 100644
--- a/WebKit2/Shared/Plugins/NPObjectProxy.h
+++ b/WebKit2/Shared/Plugins/NPObjectProxy.h
@@ -62,6 +62,8 @@ private:
     bool hasProperty(NPIdentifier propertyName);
     bool getProperty(NPIdentifier propertyName, NPVariant* result);
     bool setProperty(NPIdentifier propertyName, const NPVariant* value);
+    bool removeProperty(NPIdentifier propertyName);
+    bool enumerate(NPIdentifier** identifiers, uint32_t* identifierCount);
 
     static NPClass* npClass();
     static NPObject* NP_Allocate(NPP, NPClass*);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list