Changeset 64316 in webkit
- Timestamp:
- Jul 29, 2010 3:42:17 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r64312 r64316 1 2010-07-29 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Implement NPN_SetProperty 6 https://bugs.webkit.org/show_bug.cgi?id=43217 7 8 * WebProcess/Plugins/NPJSObject.cpp: 9 (WebKit::NPJSObject::setProperty): 10 Convert the NPVariant to a JSValue and set it on the underlying JSObject. 11 12 (WebKit::NPJSObject::NP_SetProperty): 13 Call NPJSObject::setProperty. 14 15 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 16 (WebKit::NPN_GetProperty): 17 Remove unused parameter name. 18 19 (WebKit::NPN_SetProperty): 20 Call the NPClass::setProperty function. 21 1 22 2010-07-29 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/WebKit2/WebProcess/Plugins/NPJSObject.cpp
r64312 r64316 172 172 } 173 173 174 bool NPJSObject::setProperty(NPIdentifier propertyName, const NPVariant* value) 175 { 176 IdentifierRep* identifierRep = static_cast<IdentifierRep*>(propertyName); 177 178 ExecState* exec = m_objectMap->globalExec(); 179 if (!exec) 180 return false; 181 182 JSLock lock(SilenceAssertionsOnly); 183 184 JSValue jsValue = m_objectMap->convertNPVariantToJSValue(exec, m_objectMap->globalObject(), *value); 185 if (identifierRep->isString()) { 186 PutPropertySlot slot; 187 m_jsObject->put(exec, identifierFromIdentifierRep(exec, identifierRep), jsValue, slot); 188 } else 189 m_jsObject->put(exec, identifierRep->number(), jsValue); 190 exec->clearException(); 191 192 return true; 193 } 194 174 195 bool NPJSObject::enumerate(NPIdentifier** identifiers, uint32_t* identifierCount) 175 196 { … … 306 327 } 307 328 308 bool NPJSObject::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value) 309 { 310 notImplemented(); 311 return false; 329 bool NPJSObject::NP_SetProperty(NPObject* npObject, NPIdentifier propertyName, const NPVariant* value) 330 { 331 return toNPJSObject(npObject)->setProperty(propertyName, value); 312 332 } 313 333 -
trunk/WebKit2/WebProcess/Plugins/NPJSObject.h
r64312 r64316 66 66 bool hasProperty(NPIdentifier propertyName); 67 67 bool getProperty(NPIdentifier propertyName, NPVariant* result); 68 bool setProperty(NPIdentifier propertyName, const NPVariant* value); 68 69 bool enumerate(NPIdentifier** identifiers, uint32_t* identifierCount); 69 70 bool construct(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result); -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r64312 r64316 573 573 } 574 574 575 static bool NPN_GetProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName, NPVariant* result)575 static bool NPN_GetProperty(NPP, NPObject* npObject, NPIdentifier propertyName, NPVariant* result) 576 576 { 577 577 if (npObject->_class->hasProperty && npObject->_class->getProperty) { … … 584 584 } 585 585 586 static bool NPN_SetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, const NPVariant* value) 587 { 588 notImplemented(); 586 static bool NPN_SetProperty(NPP, NPObject* npObject, NPIdentifier propertyName, const NPVariant* value) 587 { 588 if (npObject->_class->setProperty) 589 return npObject->_class->setProperty(npObject, propertyName, value); 590 589 591 return false; 590 592 }
Note: See TracChangeset
for help on using the changeset viewer.