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


The following commit has been merged in the debian/experimental branch:
commit 2efd061e87f1134db64d444e2bfa2a7288df6b5c
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 27 23:15:41 2010 +0000

    Implement JSNPObject::propertyGetter
    https://bugs.webkit.org/show_bug.cgi?id=43091
    
    Reviewed by Sam Weinig.
    
    WebKit2:
    
    * WebProcess/Plugins/JSNPObject.cpp:
    (WebKit::JSNPObject::propertyGetter):
    Ask the NPObject for its property.
    
    * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
    (WebKit::NPRuntimeObjectMap::jsNPObjectDestroyed):
    Add a stub.
    
    (WebKit::NPRuntimeObjectMap::convertNPVariantToValue):
    Implement this for everything except objects.
    
    LayoutTests:
    
    * platform/mac-wk2/Skipped:
    Add a test I forgot to add, and remove plugins/npruntime/embed-property.html because it passes now.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64174 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ff9a574..ec5b6c3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-27  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Implement JSNPObject::propertyGetter
+        https://bugs.webkit.org/show_bug.cgi?id=43091
+
+        * platform/mac-wk2/Skipped:
+        Add a test I forgot to add, and remove plugins/npruntime/embed-property.html because it passes now.
+
 2010-07-27  Martin Robinson  <mrobinson at igalia.com>
 
         Unreviewed.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index c2cd2aa..056abff 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1388,6 +1388,7 @@ fast/loader/loadInProgress.html
 http/tests/plugins
 java
 platform/mac/plugins
+plugins/attach-during-destroy.html
 plugins/clicking-missing-plugin-fires-delegate.html
 plugins/destroy-during-npp-new.html
 plugins/destroy-reentry.html
@@ -1411,7 +1412,6 @@ plugins/netscape-plugin-map-data-to-src.html
 plugins/netscape-plugin-setwindow-size-2.html
 plugins/netscape-plugin-setwindow-size.html
 plugins/npruntime/bindings-test.html
-plugins/npruntime/embed-property.html
 plugins/npruntime/enumerate.html
 plugins/npruntime/get-int-identifier-special-values.html
 plugins/npruntime/get-property-return-value.html
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index d991842..19515a1 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-27  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Implement JSNPObject::propertyGetter
+        https://bugs.webkit.org/show_bug.cgi?id=43091
+
+        * WebProcess/Plugins/JSNPObject.cpp:
+        (WebKit::JSNPObject::propertyGetter):
+        Ask the NPObject for its property.
+
+        * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
+        (WebKit::NPRuntimeObjectMap::jsNPObjectDestroyed):
+        Add a stub.
+
+        (WebKit::NPRuntimeObjectMap::convertNPVariantToValue):
+        Implement this for everything except objects.
+
 2010-07-27  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit2/WebProcess/Plugins/JSNPObject.cpp b/WebKit2/WebProcess/Plugins/JSNPObject.cpp
index 033fbdd..2f0fe69 100644
--- a/WebKit2/WebProcess/Plugins/JSNPObject.cpp
+++ b/WebKit2/WebProcess/Plugins/JSNPObject.cpp
@@ -25,9 +25,11 @@
 
 #include "JSNPObject.h"
 
+#include "NPRuntimeObjectMap.h"
 #include "NPRuntimeUtilities.h"
 #include <JavaScriptCore/Error.h>
 #include <JavaScriptCore/JSGlobalObject.h>
+#include <JavaScriptCore/JSLock.h>
 #include <JavaScriptCore/ObjectPrototype.h>
 #include <WebCore/IdentifierRep.h>
 
@@ -71,8 +73,33 @@ bool JSNPObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyN
     return false;
 }
 
-JSValue JSNPObject::propertyGetter(ExecState*, JSValue, const Identifier&)
+JSValue JSNPObject::propertyGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
+    JSNPObject* thisObj = static_cast<JSNPObject*>(asObject(slotBase));
+
+    if (!thisObj->m_npObject)
+        return throwInvalidAccessError(exec);
+
+    if (!thisObj->m_npObject->_class->getProperty)
+        return jsUndefined();
+
+    NPVariant property;
+    VOID_TO_NPVARIANT(property);
+
+    bool result;
+    {
+        JSLock::DropAllLocks dropAllLocks(SilenceAssertionsOnly);
+        NPIdentifier npIdentifier = npIdentifierFromIdentifier(propertyName);
+        result = thisObj->m_npObject->_class->getProperty(thisObj->m_npObject, npIdentifier, &property);
+        
+        // FIXME: Handle getProperty setting an exception.
+        // FIXME: Find out what happens if calling getProperty causes the plug-in to go away.
+    }
+
+    if (!result)
+        return jsUndefined();
+
+    return thisObj->m_objectMap->convertNPVariantToValue(exec, property);
     // FIXME: Implement.
     return jsUndefined();
 }
diff --git a/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.cpp b/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.cpp
index 6a3cf33..a59e069 100644
--- a/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.cpp
+++ b/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.cpp
@@ -28,6 +28,7 @@
 #include "JSNPObject.h"
 #include "NPJSObject.h"
 #include "NPRuntimeUtilities.h"
+#include "NotImplemented.h"
 #include "PluginView.h"
 #include <WebCore/Frame.h>
 
@@ -69,6 +70,41 @@ JSObject* NPRuntimeObjectMap::getOrCreateJSObject(ExecState* exec, JSGlobalObjec
     return new (exec) JSNPObject(exec, globalObject, this, npObject);
 }
 
+void NPRuntimeObjectMap::jsNPObjectDestroyed(JSNPObject* jsNPObject)
+{
+    // FIXME: Implement.
+}
+
+JSValue NPRuntimeObjectMap::convertNPVariantToValue(JSC::ExecState* exec, const NPVariant& variant)
+{
+    switch (variant.type) {
+    case NPVariantType_Void:
+        return jsUndefined();
+
+    case NPVariantType_Null:
+        return jsNull();
+
+    case NPVariantType_Bool:
+        return jsBoolean(variant.value.boolValue);
+
+    case NPVariantType_Int32:
+        return jsNumber(exec, variant.value.intValue);
+
+    case NPVariantType_Double:
+        return jsNumber(exec, variant.value.doubleValue);
+
+    case NPVariantType_String:
+        return jsString(exec, String::fromUTF8WithLatin1Fallback(variant.value.stringValue.UTF8Characters, 
+                                                                 variant.value.stringValue.UTF8Length));
+    case NPVariantType_Object:
+    default:
+        notImplemented();
+        break;
+    }
+    
+    return jsUndefined();
+}
+
 void NPRuntimeObjectMap::invalidate()
 {
     Vector<NPJSObject*> npJSObjects;
diff --git a/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.h b/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.h
index 1ae60e3..021157c 100644
--- a/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.h
+++ b/WebKit2/WebProcess/Plugins/NPRuntimeObjectMap.h
@@ -29,15 +29,18 @@
 #include <wtf/HashMap.h>
 
 struct NPObject;
+typedef struct _NPVariant NPVariant;
 
 namespace JSC {
     class ExecState;
     class JSGlobalObject;
     class JSObject;
+    class JSValue;
 }
 
 namespace WebKit {
 
+class JSNPObject;
 class NPJSObject;
 class PluginView;
 
@@ -55,6 +58,9 @@ public:
     // Returns a JSObject object that wraps the given NPObject.
     JSC::JSObject* getOrCreateJSObject(JSC::ExecState*, JSC::JSGlobalObject*, NPObject*);
 
+    void jsNPObjectDestroyed(JSNPObject*);
+
+    JSC::JSValue convertNPVariantToValue(JSC::ExecState*, const NPVariant&);
 
     // Called when the plug-in is destroyed. Will invalidate all the NPObjects.
     void invalidate();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list