[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:35:14 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 6429f942e8a7069dc0da5c3fd9f59deb93417ea4
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jul 29 22:42:17 2010 +0000
Implement NPN_SetProperty
https://bugs.webkit.org/show_bug.cgi?id=43217
Reviewed by Sam Weinig.
* WebProcess/Plugins/NPJSObject.cpp:
(WebKit::NPJSObject::setProperty):
Convert the NPVariant to a JSValue and set it on the underlying JSObject.
(WebKit::NPJSObject::NP_SetProperty):
Call NPJSObject::setProperty.
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetProperty):
Remove unused parameter name.
(WebKit::NPN_SetProperty):
Call the NPClass::setProperty function.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 63c2795..afda1a2 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,27 @@
Reviewed by Sam Weinig.
+ Implement NPN_SetProperty
+ https://bugs.webkit.org/show_bug.cgi?id=43217
+
+ * WebProcess/Plugins/NPJSObject.cpp:
+ (WebKit::NPJSObject::setProperty):
+ Convert the NPVariant to a JSValue and set it on the underlying JSObject.
+
+ (WebKit::NPJSObject::NP_SetProperty):
+ Call NPJSObject::setProperty.
+
+ * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+ (WebKit::NPN_GetProperty):
+ Remove unused parameter name.
+
+ (WebKit::NPN_SetProperty):
+ Call the NPClass::setProperty function.
+
+2010-07-29 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
Implement NPN_Enumerate
https://bugs.webkit.org/show_bug.cgi?id=43215
diff --git a/WebKit2/WebProcess/Plugins/NPJSObject.cpp b/WebKit2/WebProcess/Plugins/NPJSObject.cpp
index 002257e..9a4bb05 100644
--- a/WebKit2/WebProcess/Plugins/NPJSObject.cpp
+++ b/WebKit2/WebProcess/Plugins/NPJSObject.cpp
@@ -171,6 +171,27 @@ bool NPJSObject::getProperty(NPIdentifier propertyName, NPVariant* result)
return true;
}
+bool NPJSObject::setProperty(NPIdentifier propertyName, const NPVariant* value)
+{
+ IdentifierRep* identifierRep = static_cast<IdentifierRep*>(propertyName);
+
+ ExecState* exec = m_objectMap->globalExec();
+ if (!exec)
+ return false;
+
+ JSLock lock(SilenceAssertionsOnly);
+
+ JSValue jsValue = m_objectMap->convertNPVariantToJSValue(exec, m_objectMap->globalObject(), *value);
+ if (identifierRep->isString()) {
+ PutPropertySlot slot;
+ m_jsObject->put(exec, identifierFromIdentifierRep(exec, identifierRep), jsValue, slot);
+ } else
+ m_jsObject->put(exec, identifierRep->number(), jsValue);
+ exec->clearException();
+
+ return true;
+}
+
bool NPJSObject::enumerate(NPIdentifier** identifiers, uint32_t* identifierCount)
{
ExecState* exec = m_objectMap->globalExec();
@@ -305,10 +326,9 @@ bool NPJSObject::NP_GetProperty(NPObject* npObject, NPIdentifier propertyName, N
return toNPJSObject(npObject)->getProperty(propertyName, result);
}
-bool NPJSObject::NP_SetProperty(NPObject*, NPIdentifier propertyName, const NPVariant* value)
+bool NPJSObject::NP_SetProperty(NPObject* npObject, NPIdentifier propertyName, const NPVariant* value)
{
- notImplemented();
- return false;
+ return toNPJSObject(npObject)->setProperty(propertyName, value);
}
bool NPJSObject::NP_Enumerate(NPObject* npObject, NPIdentifier** identifiers, uint32_t* identifierCount)
diff --git a/WebKit2/WebProcess/Plugins/NPJSObject.h b/WebKit2/WebProcess/Plugins/NPJSObject.h
index 281b2c0..e1b1fe7 100644
--- a/WebKit2/WebProcess/Plugins/NPJSObject.h
+++ b/WebKit2/WebProcess/Plugins/NPJSObject.h
@@ -65,6 +65,7 @@ private:
bool invokeDefault(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
bool hasProperty(NPIdentifier propertyName);
bool getProperty(NPIdentifier propertyName, NPVariant* result);
+ bool setProperty(NPIdentifier propertyName, const NPVariant* value);
bool enumerate(NPIdentifier** identifiers, uint32_t* identifierCount);
bool construct(const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
index ad65717..7404226 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
@@ -572,7 +572,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, NPObject* npObject, NPIdentifier propertyName, NPVariant* result)
{
if (npObject->_class->hasProperty && npObject->_class->getProperty) {
if (npObject->_class->hasProperty(npObject, propertyName))
@@ -583,9 +583,11 @@ 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, NPObject* npObject, NPIdentifier propertyName, const NPVariant* value)
{
- notImplemented();
+ if (npObject->_class->setProperty)
+ return npObject->_class->setProperty(npObject, propertyName, value);
+
return false;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list