[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:32:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e8bdca2569acbe16e762f8d69ed4aa60625e2d01
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 28 23:38:24 2010 +0000

    Implement NPN_Invoke
    https://bugs.webkit.org/show_bug.cgi?id=43158
    
    Reviewed by Sam Weinig.
    
    WebKit2:
    
    * WebProcess/Plugins/NPJSObject.cpp:
    (WebKit::NPJSObject::hasMethod):
    Use the free getCallData function.
    
    (WebKit::NPJSObject::invoke):
    Get the JavaScript function and call it.
    
    (WebKit::NPJSObject::NP_Invoke):
    Call NPJSObject::invoke.
    
    * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
    (WebKit::NPN_Invoke):
    Call the NPClass::invoke function.
    
    LayoutTests:
    
    * platform/mac-wk2/Skipped:
    Remove plugins/npruntime/invoke.html.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64244 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5d4bcef..57f5ca1 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -33,6 +33,16 @@
 
         Reviewed by Sam Weinig.
 
+        Implement NPN_Invoke
+        https://bugs.webkit.org/show_bug.cgi?id=43158
+
+        * platform/mac-wk2/Skipped:
+        Remove plugins/npruntime/invoke.html.
+
+2010-07-28  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
         Implement NPN_HasMethod
         https://bugs.webkit.org/show_bug.cgi?id=43155
 
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 1ba5abc..593d8dd 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -1415,7 +1415,6 @@ plugins/npruntime/bindings-test.html
 plugins/npruntime/enumerate.html
 plugins/npruntime/get-property-return-value.html
 plugins/npruntime/invoke-default.html
-plugins/npruntime/invoke.html
 plugins/npruntime/npruntime.html
 plugins/npruntime/round-trip-npobject.html
 plugins/override-node-method.html
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index f3705fc..7ef19eb 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,27 @@
 
         Reviewed by Sam Weinig.
 
+        Implement NPN_Invoke
+        https://bugs.webkit.org/show_bug.cgi?id=43158
+
+        * WebProcess/Plugins/NPJSObject.cpp:
+        (WebKit::NPJSObject::hasMethod):
+        Use the free getCallData function.
+
+        (WebKit::NPJSObject::invoke):
+        Get the JavaScript function and call it.
+
+        (WebKit::NPJSObject::NP_Invoke):
+        Call NPJSObject::invoke.
+
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+        (WebKit::NPN_Invoke):
+        Call the NPClass::invoke function.
+
+2010-07-28  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
         Implement NPN_HasMethod
         https://bugs.webkit.org/show_bug.cgi?id=43155
 
diff --git a/WebKit2/WebProcess/Plugins/NPJSObject.cpp b/WebKit2/WebProcess/Plugins/NPJSObject.cpp
index 13ffe64..0ee95c2 100644
--- a/WebKit2/WebProcess/Plugins/NPJSObject.cpp
+++ b/WebKit2/WebProcess/Plugins/NPJSObject.cpp
@@ -97,11 +97,44 @@ bool NPJSObject::hasMethod(NPIdentifier methodName)
 
     JSValue value = m_jsObject->get(exec, identifierFromIdentifierRep(exec, identifierRep));    
     exec->clearException();
-    if (!value.isObject())
+
+    CallData callData;
+    return getCallData(value, callData) != CallTypeNone;
+}
+
+bool NPJSObject::invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+{
+    IdentifierRep* identifierRep = static_cast<IdentifierRep*>(methodName);
+    
+    if (!identifierRep->isString())
+        return false;
+    
+    ExecState* exec = m_objectMap->globalExec();
+    if (!exec)
         return false;
+    
+    JSLock lock(SilenceAssertionsOnly);
 
+    JSValue function = m_jsObject->get(exec, identifierFromIdentifierRep(exec, identifierRep));
     CallData callData;
-    return value.toObject(exec)->getCallData(callData) != CallTypeNone;
+    CallType callType = getCallData(function, callData);
+    if (callType == CallTypeNone)
+        return false;
+
+    // Convert the passed in arguments.
+    MarkedArgumentBuffer argumentList;
+    for (uint32_t i = 0; i < argumentCount; ++i)
+        argumentList.append(m_objectMap->convertNPVariantToJSValue(exec, arguments[i]));
+
+    exec->globalData().timeoutChecker.start();
+    JSValue value = JSC::call(exec, function, callType, callData, m_jsObject, argumentList);
+    exec->globalData().timeoutChecker.stop();
+
+    // Convert and return the result of the function call.
+    m_objectMap->convertJSValueToNPVariant(exec, value, *result);
+    exec->clearException();
+    
+    return true;
 }
 
 bool NPJSObject::hasProperty(NPIdentifier identifier)
@@ -183,13 +216,12 @@ bool NPJSObject::NP_HasMethod(NPObject* npObject, NPIdentifier methodName)
     return toNPJSObject(npObject)->hasMethod(methodName);
 }
     
-bool NPJSObject::NP_Invoke(NPObject*, NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result)
+bool NPJSObject::NP_Invoke(NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
 {
-    notImplemented();
-    return false;
+    return toNPJSObject(npObject)->invoke(methodName, arguments, argumentCount, result);
 }
     
-bool NPJSObject::NP_InvokeDefault(NPObject*, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result)
+bool NPJSObject::NP_InvokeDefault(NPObject*, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
 {
     notImplemented();
     return false;
diff --git a/WebKit2/WebProcess/Plugins/NPJSObject.h b/WebKit2/WebProcess/Plugins/NPJSObject.h
index c2664e4..5029247 100644
--- a/WebKit2/WebProcess/Plugins/NPJSObject.h
+++ b/WebKit2/WebProcess/Plugins/NPJSObject.h
@@ -60,6 +60,7 @@ private:
     void initialize(NPRuntimeObjectMap*, JSC::JSObject* jsObject);
 
     bool hasMethod(NPIdentifier methodName);
+    bool invoke(NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result);
     bool hasProperty(NPIdentifier propertyName);
     bool getProperty(NPIdentifier propertyName, NPVariant* result);
 
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
index c342108..501d4fd 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
@@ -530,9 +530,11 @@ static void NPN_ReleaseObject(NPObject *npObject)
     releaseNPObject(npObject);
 }
 
-static bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result)
+static bool NPN_Invoke(NPP, NPObject *npObject, NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result)
 {
-    notImplemented();
+    if (npObject->_class->invoke)
+        return npObject->_class->invoke(npObject, methodName, arguments, argumentCount, result);
+
     return false;
 }
 
@@ -548,7 +550,7 @@ static bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *
     return false;
 }
 
-static bool NPN_GetProperty(NPP npp, NPObject *npObject, NPIdentifier propertyName, NPVariant *result)
+static bool NPN_GetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, NPVariant* result)
 {
     if (npObject->_class->hasProperty && npObject->_class->getProperty) {
         if (npObject->_class->hasProperty(npObject, propertyName))
@@ -559,19 +561,19 @@ static bool NPN_GetProperty(NPP npp, NPObject *npObject, NPIdentifier propertyNa
     return false;
 }
 
-static bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value)
+static bool NPN_SetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, const NPVariant* value)
 {
     notImplemented();
     return false;
 }
 
-static bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName)
+static bool NPN_RemoveProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName)
 {
     notImplemented();
     return false;
 }
 
-static bool NPN_HasProperty(NPP, NPObject *npObject, NPIdentifier propertyName)
+static bool NPN_HasProperty(NPP, NPObject* npObject, NPIdentifier propertyName)
 {
     if (npObject->_class->hasProperty)
         return npObject->_class->hasProperty(npObject, propertyName);
@@ -579,7 +581,7 @@ static bool NPN_HasProperty(NPP, NPObject *npObject, NPIdentifier propertyName)
     return false;
 }
 
-static bool NPN_HasMethod(NPP, NPObject *npObject, NPIdentifier methodName)
+static bool NPN_HasMethod(NPP, NPObject* npObject, NPIdentifier methodName)
 {
     if (npObject->_class->hasMethod)
         return npObject->_class->hasMethod(npObject, methodName);
@@ -587,12 +589,12 @@ static bool NPN_HasMethod(NPP, NPObject *npObject, NPIdentifier methodName)
     return false;
 }
 
-static void NPN_ReleaseVariantValue(NPVariant *variant)
+static void NPN_ReleaseVariantValue(NPVariant* variant)
 {
     releaseNPVariantValue(variant);
 }
 
-static void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
+static void NPN_SetException(NPObject* npobj, const NPUTF8* message)
 {
     notImplemented();
 }
@@ -607,37 +609,37 @@ static void NPN_PopPopupsEnabledState(NPP instance)
     notImplemented();
 }
     
-static bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count)
+static bool NPN_Enumerate(NPP npp, NPObject* npobj, NPIdentifier** identifier, uint32_t* count)
 {
     notImplemented();
     return false;
 }
 
-static void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)
+static void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void*), void* userData)
 {
     notImplemented();
 }
 
-static bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
+static bool NPN_Construct(NPP npp, NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)
 {
     notImplemented();
     return false;
 }
 
-static NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char *url, char **value, uint32_t *len)
+static NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len)
 {
     notImplemented();
     return NPERR_GENERIC_ERROR;
 }
 
-static NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char *url, const char *value, uint32_t len)
+static NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len)
 {
     notImplemented();
     return NPERR_GENERIC_ERROR;
 }
 
-static NPError NPN_GetAuthenticationInfo(NPP instance, const char *protocol, const char *host, int32_t port, const char *scheme, 
-                                         const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen)
+static NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, 
+                                         const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen)
 {
     notImplemented();
     return NPERR_GENERIC_ERROR;
@@ -660,7 +662,7 @@ static NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu)
     return NPERR_GENERIC_ERROR;
 }
 
-static NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace)
+static NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double* destX, double* destY, NPCoordinateSpace destSpace)
 {
     notImplemented();
     return false;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list