Changeset 64240 in webkit
- Timestamp:
- Jul 28, 2010 4:03:25 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64237 r64240 1 2010-07-28 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Implement NPN_HasMethod 6 https://bugs.webkit.org/show_bug.cgi?id=43155 7 8 * platform/mac-wk2/Skipped: 9 Remove plugins/npruntime/invoke-browserfuncs.html. 10 1 11 2010-07-28 Adam Barth <abarth@webkit.org> 2 12 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r64235 r64240 1415 1415 plugins/npruntime/enumerate.html 1416 1416 plugins/npruntime/get-property-return-value.html 1417 plugins/npruntime/invoke-browserfuncs.html1418 1417 plugins/npruntime/invoke-default.html 1419 1418 plugins/npruntime/invoke.html -
trunk/WebKit2/ChangeLog
r64238 r64240 1 2010-07-28 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Implement NPN_HasMethod 6 https://bugs.webkit.org/show_bug.cgi?id=43155 7 8 * WebProcess/Plugins/NPJSObject.cpp: 9 (WebKit::NPJSObject::hasMethod): 10 Check if the JSObject has a property with the given name. If it does, check that the value is a function. 11 12 (WebKit::NPJSObject::hasProperty): 13 Add a JSLock. 14 15 (WebKit::NPJSObject::npClass): 16 Add some stubbed out functions. 17 18 (WebKit::NPJSObject::NP_HasMethod): 19 Call NPJSObject::hasMethod. 20 21 (WebKit::NPJSObject::NP_Invoke): 22 (WebKit::NPJSObject::NP_InvokeDefault): 23 (WebKit::NPJSObject::NP_SetProperty): 24 Stub out functions. 25 26 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 27 (WebKit::NPN_HasMethod): 28 Call the NPClass::hasMethod function. 29 1 30 2010-07-28 Brady Eidson <beidson@apple.com> 2 31 -
trunk/WebKit2/WebProcess/Plugins/NPJSObject.cpp
r64231 r64240 83 83 } 84 84 85 bool NPJSObject::hasProperty(NPIdentifier identifier) 86 { 87 IdentifierRep* identifierRep = static_cast<IdentifierRep*>(identifier); 88 85 bool NPJSObject::hasMethod(NPIdentifier methodName) 86 { 87 IdentifierRep* identifierRep = static_cast<IdentifierRep*>(methodName); 88 89 if (!identifierRep->isString()) 90 return false; 91 89 92 ExecState* exec = m_objectMap->globalExec(); 90 93 if (!exec) 91 94 return false; 92 95 96 JSLock lock(SilenceAssertionsOnly); 97 98 JSValue value = m_jsObject->get(exec, identifierFromIdentifierRep(exec, identifierRep)); 99 exec->clearException(); 100 if (!value.isObject()) 101 return false; 102 103 CallData callData; 104 return value.toObject(exec)->getCallData(callData) != CallTypeNone; 105 } 106 107 bool NPJSObject::hasProperty(NPIdentifier identifier) 108 { 109 IdentifierRep* identifierRep = static_cast<IdentifierRep*>(identifier); 110 111 ExecState* exec = m_objectMap->globalExec(); 112 if (!exec) 113 return false; 114 115 JSLock lock(SilenceAssertionsOnly); 116 93 117 bool result; 94 118 if (identifierRep->isString()) … … 127 151 NP_Allocate, 128 152 NP_Deallocate, 129 0,130 153 0, 131 0, 132 0, 154 NP_HasMethod, 155 NP_Invoke, 156 NP_InvokeDefault, 133 157 NP_HasProperty, 134 158 NP_GetProperty, 135 0,159 NP_SetProperty, 136 160 0, 137 161 0, … … 155 179 } 156 180 181 bool NPJSObject::NP_HasMethod(NPObject* npObject, NPIdentifier methodName) 182 { 183 return toNPJSObject(npObject)->hasMethod(methodName); 184 } 185 186 bool NPJSObject::NP_Invoke(NPObject*, NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result) 187 { 188 notImplemented(); 189 return false; 190 } 191 192 bool NPJSObject::NP_InvokeDefault(NPObject*, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result) 193 { 194 notImplemented(); 195 return false; 196 } 197 157 198 bool NPJSObject::NP_HasProperty(NPObject* npObject, NPIdentifier propertyName) 158 199 { 159 200 return toNPJSObject(npObject)->hasProperty(propertyName); 160 201 } 161 202 162 203 bool NPJSObject::NP_GetProperty(NPObject* npObject, NPIdentifier propertyName, NPVariant* result) 163 204 { … … 165 206 } 166 207 208 bool NPJSObject::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value) 209 { 210 notImplemented(); 211 return false; 212 } 213 167 214 } // namespace WebKit -
trunk/WebKit2/WebProcess/Plugins/NPJSObject.h
r64167 r64240 60 60 void initialize(NPRuntimeObjectMap*, JSC::JSObject* jsObject); 61 61 62 bool hasProperty(NPIdentifier); 63 bool getProperty(NPIdentifier, NPVariant* result); 62 bool hasMethod(NPIdentifier methodName); 63 bool hasProperty(NPIdentifier propertyName); 64 bool getProperty(NPIdentifier propertyName, NPVariant* result); 64 65 65 66 static NPClass* npClass(); 66 67 static NPObject* NP_Allocate(NPP, NPClass*); 67 68 static void NP_Deallocate(NPObject*); 68 static bool NP_HasProperty(NPObject* npobj, NPIdentifier name); 69 static bool NP_GetProperty(NPObject* npobj, NPIdentifier name, NPVariant* result); 69 static bool NP_HasMethod(NPObject*, NPIdentifier methodName); 70 static bool NP_Invoke(NPObject*, NPIdentifier methodName, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result); 71 static bool NP_InvokeDefault(NPObject*, const NPVariant *arguments, uint32_t argumentCount, NPVariant *result); 72 static bool NP_HasProperty(NPObject*, NPIdentifier propertyName); 73 static bool NP_GetProperty(NPObject*, NPIdentifier propertyName, NPVariant* result); 74 static bool NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value); 70 75 71 76 NPRuntimeObjectMap* m_objectMap; -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r63756 r64240 572 572 } 573 573 574 static bool NPN_HasProperty(NPP npp, NPObject *npObject, NPIdentifier propertyName)574 static bool NPN_HasProperty(NPP, NPObject *npObject, NPIdentifier propertyName) 575 575 { 576 576 if (npObject->_class->hasProperty) … … 580 580 } 581 581 582 static bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName) 583 { 584 notImplemented(); 582 static bool NPN_HasMethod(NPP, NPObject *npObject, NPIdentifier methodName) 583 { 584 if (npObject->_class->hasMethod) 585 return npObject->_class->hasMethod(npObject, methodName); 586 585 587 return false; 586 588 }
Note: See TracChangeset
for help on using the changeset viewer.