Changeset 64244 in webkit
- Timestamp:
- Jul 28, 2010 4:38:24 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64242 r64244 29 29 * platform/chromium-linux/svg/custom/mask-colorspace-expected.png: Added. 30 30 * platform/chromium/test_expectations.txt: 31 32 2010-07-28 Anders Carlsson <andersca@apple.com> 33 34 Reviewed by Sam Weinig. 35 36 Implement NPN_Invoke 37 https://bugs.webkit.org/show_bug.cgi?id=43158 38 39 * platform/mac-wk2/Skipped: 40 Remove plugins/npruntime/invoke.html. 31 41 32 42 2010-07-28 Anders Carlsson <andersca@apple.com> -
trunk/LayoutTests/platform/mac-wk2/Skipped
r64240 r64244 1416 1416 plugins/npruntime/get-property-return-value.html 1417 1417 plugins/npruntime/invoke-default.html 1418 plugins/npruntime/invoke.html1419 1418 plugins/npruntime/npruntime.html 1420 1419 plugins/npruntime/round-trip-npobject.html -
trunk/WebKit2/ChangeLog
r64240 r64244 1 2010-07-28 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Implement NPN_Invoke 6 https://bugs.webkit.org/show_bug.cgi?id=43158 7 8 * WebProcess/Plugins/NPJSObject.cpp: 9 (WebKit::NPJSObject::hasMethod): 10 Use the free getCallData function. 11 12 (WebKit::NPJSObject::invoke): 13 Get the JavaScript function and call it. 14 15 (WebKit::NPJSObject::NP_Invoke): 16 Call NPJSObject::invoke. 17 18 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 19 (WebKit::NPN_Invoke): 20 Call the NPClass::invoke function. 21 1 22 2010-07-28 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/WebKit2/WebProcess/Plugins/NPJSObject.cpp
r64240 r64244 98 98 JSValue value = m_jsObject->get(exec, identifierFromIdentifierRep(exec, identifierRep)); 99 99 exec->clearException(); 100 if (!value.isObject())101 return false;102 100 103 101 CallData callData; 104 return value.toObject(exec)->getCallData(callData) != CallTypeNone; 102 return getCallData(value, callData) != CallTypeNone; 103 } 104 105 bool NPJSObject::invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) 106 { 107 IdentifierRep* identifierRep = static_cast<IdentifierRep*>(methodName); 108 109 if (!identifierRep->isString()) 110 return false; 111 112 ExecState* exec = m_objectMap->globalExec(); 113 if (!exec) 114 return false; 115 116 JSLock lock(SilenceAssertionsOnly); 117 118 JSValue function = m_jsObject->get(exec, identifierFromIdentifierRep(exec, identifierRep)); 119 CallData callData; 120 CallType callType = getCallData(function, callData); 121 if (callType == CallTypeNone) 122 return false; 123 124 // Convert the passed in arguments. 125 MarkedArgumentBuffer argumentList; 126 for (uint32_t i = 0; i < argumentCount; ++i) 127 argumentList.append(m_objectMap->convertNPVariantToJSValue(exec, arguments[i])); 128 129 exec->globalData().timeoutChecker.start(); 130 JSValue value = JSC::call(exec, function, callType, callData, m_jsObject, argumentList); 131 exec->globalData().timeoutChecker.stop(); 132 133 // Convert and return the result of the function call. 134 m_objectMap->convertJSValueToNPVariant(exec, value, *result); 135 exec->clearException(); 136 137 return true; 105 138 } 106 139 … … 184 217 } 185 218 186 bool NPJSObject::NP_Invoke(NPObject*, NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result) 219 bool NPJSObject::NP_Invoke(NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) 220 { 221 return toNPJSObject(npObject)->invoke(methodName, arguments, argumentCount, result); 222 } 223 224 bool NPJSObject::NP_InvokeDefault(NPObject*, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) 187 225 { 188 226 notImplemented(); … … 190 228 } 191 229 192 bool NPJSObject::NP_InvokeDefault(NPObject*, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result) 230 bool NPJSObject::NP_HasProperty(NPObject* npObject, NPIdentifier propertyName) 231 { 232 return toNPJSObject(npObject)->hasProperty(propertyName); 233 } 234 235 bool NPJSObject::NP_GetProperty(NPObject* npObject, NPIdentifier propertyName, NPVariant* result) 236 { 237 return toNPJSObject(npObject)->getProperty(propertyName, result); 238 } 239 240 bool NPJSObject::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value) 193 241 { 194 242 notImplemented(); 195 243 return false; 196 244 } 197 198 bool NPJSObject::NP_HasProperty(NPObject* npObject, NPIdentifier propertyName)199 {200 return toNPJSObject(npObject)->hasProperty(propertyName);201 }202 203 bool NPJSObject::NP_GetProperty(NPObject* npObject, NPIdentifier propertyName, NPVariant* result)204 {205 return toNPJSObject(npObject)->getProperty(propertyName, result);206 }207 208 bool NPJSObject::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value)209 {210 notImplemented();211 return false;212 }213 245 214 246 } // namespace WebKit -
trunk/WebKit2/WebProcess/Plugins/NPJSObject.h
r64240 r64244 61 61 62 62 bool hasMethod(NPIdentifier methodName); 63 bool invoke(NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result); 63 64 bool hasProperty(NPIdentifier propertyName); 64 65 bool getProperty(NPIdentifier propertyName, NPVariant* result); -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r64240 r64244 531 531 } 532 532 533 static bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) 534 { 535 notImplemented(); 533 static bool NPN_Invoke(NPP, NPObject *npObject, NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result) 534 { 535 if (npObject->_class->invoke) 536 return npObject->_class->invoke(npObject, methodName, arguments, argumentCount, result); 537 536 538 return false; 537 539 } … … 549 551 } 550 552 551 static bool NPN_GetProperty(NPP npp, NPObject *npObject, NPIdentifier propertyName, NPVariant *result)553 static bool NPN_GetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, NPVariant* result) 552 554 { 553 555 if (npObject->_class->hasProperty && npObject->_class->getProperty) { … … 560 562 } 561 563 562 static bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value)563 { 564 notImplemented(); 565 return false; 566 } 567 568 static bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName)569 { 570 notImplemented(); 571 return false; 572 } 573 574 static bool NPN_HasProperty(NPP, NPObject *npObject, NPIdentifier propertyName)564 static bool NPN_SetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, const NPVariant* value) 565 { 566 notImplemented(); 567 return false; 568 } 569 570 static bool NPN_RemoveProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName) 571 { 572 notImplemented(); 573 return false; 574 } 575 576 static bool NPN_HasProperty(NPP, NPObject* npObject, NPIdentifier propertyName) 575 577 { 576 578 if (npObject->_class->hasProperty) … … 580 582 } 581 583 582 static bool NPN_HasMethod(NPP, NPObject *npObject, NPIdentifier methodName)584 static bool NPN_HasMethod(NPP, NPObject* npObject, NPIdentifier methodName) 583 585 { 584 586 if (npObject->_class->hasMethod) … … 588 590 } 589 591 590 static void NPN_ReleaseVariantValue(NPVariant *variant)592 static void NPN_ReleaseVariantValue(NPVariant* variant) 591 593 { 592 594 releaseNPVariantValue(variant); 593 595 } 594 596 595 static void NPN_SetException(NPObject *npobj, const NPUTF8 *message)597 static void NPN_SetException(NPObject* npobj, const NPUTF8* message) 596 598 { 597 599 notImplemented(); … … 608 610 } 609 611 610 static bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count)611 { 612 notImplemented(); 613 return false; 614 } 615 616 static void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)617 { 618 notImplemented(); 619 } 620 621 static bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)622 { 623 notImplemented(); 624 return false; 625 } 626 627 static NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char *url, char **value, uint32_t *len)612 static bool NPN_Enumerate(NPP npp, NPObject* npobj, NPIdentifier** identifier, uint32_t* count) 613 { 614 notImplemented(); 615 return false; 616 } 617 618 static void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void*), void* userData) 619 { 620 notImplemented(); 621 } 622 623 static bool NPN_Construct(NPP npp, NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result) 624 { 625 notImplemented(); 626 return false; 627 } 628 629 static NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len) 628 630 { 629 631 notImplemented(); … … 631 633 } 632 634 633 static NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char *url, const char *value, uint32_t len)635 static NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len) 634 636 { 635 637 notImplemented(); … … 637 639 } 638 640 639 static NPError NPN_GetAuthenticationInfo(NPP instance, const char *protocol, const char *host, int32_t port, const char *scheme,640 const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen)641 static NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, 642 const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen) 641 643 { 642 644 notImplemented(); … … 661 663 } 662 664 663 static NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace)665 static NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double* destX, double* destY, NPCoordinateSpace destSpace) 664 666 { 665 667 notImplemented();
Note: See TracChangeset
for help on using the changeset viewer.