diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 04:42:57 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 04:42:57 +0000 |
commit | 870b2878217f1b48579b7e0baf1b2fc5e8e6d086 (patch) | |
tree | 58e68d023049740d4a116609115d62d4e176e8a3 /webkit/api | |
parent | 99ddfd29900cc4caa1f1ffd979cc09be3f104336 (diff) | |
download | chromium_src-870b2878217f1b48579b7e0baf1b2fc5e8e6d086.zip chromium_src-870b2878217f1b48579b7e0baf1b2fc5e8e6d086.tar.gz chromium_src-870b2878217f1b48579b7e0baf1b2fc5e8e6d086.tar.bz2 |
Remove all direct calls to NPN_ functions in WebCore. The replacement for these is the WebKit::WebBindings API.
This will be a 2 sided commit with https://bugs.webkit.org/show_bug.cgi?id=28089
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/164214
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api')
-rw-r--r-- | webkit/api/public/WebBindings.h | 3 | ||||
-rw-r--r-- | webkit/api/src/WebBindings.cpp | 48 |
2 files changed, 30 insertions, 21 deletions
diff --git a/webkit/api/public/WebBindings.h b/webkit/api/public/WebBindings.h index 17af60f..76e0f13 100644 --- a/webkit/api/public/WebBindings.h +++ b/webkit/api/public/WebBindings.h @@ -53,6 +53,9 @@ namespace WebKit { // NPN_Enumerate WEBKIT_API static bool enumerate(NPP id, NPObject* obj, NPIdentifier** identifier, uint32_t* val); + // NPN_Evaluate + WEBKIT_API static bool evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* result); + // NPN_EvaluateHelper WEBKIT_API static bool evaluateHelper(NPP npp, bool popups_allowed, NPObject* npobj, NPString* npscript, NPVariant* result); diff --git a/webkit/api/src/WebBindings.cpp b/webkit/api/src/WebBindings.cpp index 0aee60e..f4567d4 100644 --- a/webkit/api/src/WebBindings.cpp +++ b/webkit/api/src/WebBindings.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "WebBindings.h" +#include "npruntime_impl.h" #include "npruntime_priv.h" #include "webkit/api/public/WebDragData.h" @@ -56,62 +57,67 @@ namespace WebKit { bool WebBindings::construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant* result) { - return NPN_Construct(npp, npobj, args, argCount, result); + return _NPN_Construct(npp, npobj, args, argCount, result); } NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) { - return NPN_CreateObject(npp, npClass); + return _NPN_CreateObject(npp, npClass); } bool WebBindings::enumerate(NPP id, NPObject* obj, NPIdentifier** identifier, uint32_t* val) { - return NPN_Enumerate(id, obj, identifier, val); + return _NPN_Enumerate(id, obj, identifier, val); +} + +bool WebBindings::evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* result) +{ + return _NPN_Evaluate(npp, npObject, npScript, result); } bool WebBindings::evaluateHelper(NPP npp, bool popups_allowed, NPObject* npobj, NPString* npscript, NPVariant* result) { - return NPN_EvaluateHelper(npp, popups_allowed, npobj, npscript, result); + return _NPN_EvaluateHelper(npp, popups_allowed, npobj, npscript, result); } NPIdentifier WebBindings::getIntIdentifier(int32_t number) { - return NPN_GetIntIdentifier(number); + return _NPN_GetIntIdentifier(number); } bool WebBindings::getProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, NPVariant *result) { - return NPN_GetProperty(npp, obj, propertyName, result); + return _NPN_GetProperty(npp, obj, propertyName, result); } NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string) { - return NPN_GetStringIdentifier(string); + return _NPN_GetStringIdentifier(string); } void WebBindings::getStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers) { - NPN_GetStringIdentifiers(names, nameCount, identifiers); + _NPN_GetStringIdentifiers(names, nameCount, identifiers); } bool WebBindings::hasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName) { - return NPN_HasMethod(npp, npObject, methodName); + return _NPN_HasMethod(npp, npObject, methodName); } bool WebBindings::hasProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName) { - return NPN_HasProperty(npp, npObject, propertyName); + return _NPN_HasProperty(npp, npObject, propertyName); } bool WebBindings::identifierIsString(NPIdentifier identifier) { - return NPN_IdentifierIsString(identifier); + return _NPN_IdentifierIsString(identifier); } int32_t WebBindings::intFromIdentifier(NPIdentifier identifier) { - return NPN_IntFromIdentifier(identifier); + return _NPN_IntFromIdentifier(identifier); } void WebBindings::initializeVariantWithStringCopy(NPVariant* variant, const NPString* value) @@ -125,42 +131,42 @@ void WebBindings::initializeVariantWithStringCopy(NPVariant* variant, const NPSt bool WebBindings::invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) { - return NPN_Invoke(npp, npObject, methodName, arguments, argumentCount, result); + return _NPN_Invoke(npp, npObject, methodName, arguments, argumentCount, result); } bool WebBindings::invokeDefault(NPP id, NPObject* obj, const NPVariant* args, uint32_t count, NPVariant* result) { - return NPN_InvokeDefault(id, obj, args, count, result); + return _NPN_InvokeDefault(id, obj, args, count, result); } void WebBindings::releaseObject(NPObject* npObject) { - return NPN_ReleaseObject(npObject); + return _NPN_ReleaseObject(npObject); } void WebBindings::releaseVariantValue(NPVariant* variant) { - NPN_ReleaseVariantValue(variant); + _NPN_ReleaseVariantValue(variant); } bool WebBindings::removeProperty(NPP id, NPObject* object, NPIdentifier identifier) { - return NPN_RemoveProperty(id, object, identifier); + return _NPN_RemoveProperty(id, object, identifier); } NPObject* WebBindings::retainObject(NPObject* npObject) { - return NPN_RetainObject(npObject); + return _NPN_RetainObject(npObject); } void WebBindings::setException(NPObject* obj, const NPUTF8* message) { - NPN_SetException(obj, message); + _NPN_SetException(obj, message); } bool WebBindings::setProperty(NPP id, NPObject* obj, NPIdentifier identifier, const NPVariant* variant) { - return NPN_SetProperty(id, obj, identifier, variant); + return _NPN_SetProperty(id, obj, identifier, variant); } void WebBindings::unregisterObject(NPObject* npObject) @@ -172,7 +178,7 @@ void WebBindings::unregisterObject(NPObject* npObject) NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier) { - return NPN_UTF8FromIdentifier(identifier); + return _NPN_UTF8FromIdentifier(identifier); } void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NPUTF8*& string, int32_t& number, bool& isString) |