summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 00:35:33 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 00:35:33 +0000
commita3929294e9176abc6085d87cb2c6f8f8417b58f3 (patch)
tree82db7bd5e99b1ddcc4ab0efb9c43decf3698b92c
parent2da90e5f4e6deae2902ea1de2f4a76544885e1d8 (diff)
downloadchromium_src-a3929294e9176abc6085d87cb2c6f8f8417b58f3.zip
chromium_src-a3929294e9176abc6085d87cb2c6f8f8417b58f3.tar.gz
chromium_src-a3929294e9176abc6085d87cb2c6f8f8417b58f3.tar.bz2
Continue eliminating direct NPN_ function calls that go from Chromium code to WebKit code. The long-term goal is to be able to link WebKit as a DLL.
TEST=none BUG=none Review URL: http://codereview.chromium.org/160310 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22031 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/plugin_messages.h8
-rw-r--r--chrome/plugin/npobject_proxy.cc4
-rw-r--r--chrome/plugin/npobject_stub.cc37
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc4
-rw-r--r--chrome/plugin/webplugin_proxy.cc7
-rw-r--r--chrome/renderer/external_host_bindings.cc30
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc6
-rw-r--r--webkit/api/public/WebBindings.h37
-rw-r--r--webkit/api/src/WebBindings.cpp55
9 files changed, 146 insertions, 42 deletions
diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h
index dd1ee18..5c35544 100644
--- a/chrome/common/plugin_messages.h
+++ b/chrome/common/plugin_messages.h
@@ -21,6 +21,7 @@
#include "googleurl/src/gurl.h"
#include "ipc/ipc_message_utils.h"
#include "third_party/npapi/bindings/npapi.h"
+#include "webkit/api/public/WebBindings.h"
#include "webkit/api/public/WebInputEvent.h"
#include "webkit/glue/npruntime_util.h"
@@ -321,12 +322,13 @@ struct ParamTraits<NPIdentifier_Param> {
return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier);
}
static void Log(const param_type& p, std::wstring* l) {
- if (NPN_IdentifierIsString(p.identifier)) {
- NPUTF8* str = NPN_UTF8FromIdentifier(p.identifier);
+ if (WebKit::WebBindings::identifierIsString(p.identifier)) {
+ NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier);
l->append(UTF8ToWide(str));
NPN_MemFree(str);
} else {
- l->append(IntToWString(NPN_IntFromIdentifier(p.identifier)));
+ l->append(IntToWString(
+ WebKit::WebBindings::intFromIdentifier(p.identifier)));
}
}
};
diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc
index bc99ffe..f224cdb 100644
--- a/chrome/plugin/npobject_proxy.cc
+++ b/chrome/plugin/npobject_proxy.cc
@@ -8,9 +8,11 @@
#include "chrome/common/plugin_messages.h"
#include "chrome/plugin/npobject_util.h"
#include "chrome/plugin/plugin_channel_base.h"
+#include "webkit/api/public/WebBindings.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/plugins/plugin_instance.h"
+using WebKit::WebBindings;
struct NPObjectWrapper {
NPObject object;
@@ -73,7 +75,7 @@ NPObject* NPObjectProxy::Create(PluginChannelBase* channel,
base::WaitableEvent* modal_dialog_event,
const GURL& page_url) {
NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>(
- NPN_CreateObject(0, &npclass_proxy_));
+ WebBindings::createObject(0, &npclass_proxy_));
obj->proxy = new NPObjectProxy(
channel, route_id, npobject_ptr, modal_dialog_event, page_url);
diff --git a/chrome/plugin/npobject_stub.cc b/chrome/plugin/npobject_stub.cc
index 4345d37..7287f4c 100644
--- a/chrome/plugin/npobject_stub.cc
+++ b/chrome/plugin/npobject_stub.cc
@@ -11,6 +11,9 @@
#include "chrome/renderer/webplugin_delegate_proxy.h"
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
+#include "webkit/api/public/WebBindings.h"
+
+using WebKit::WebBindings;
NPObjectStub::NPObjectStub(
NPObject* npobject,
@@ -28,7 +31,7 @@ NPObjectStub::NPObjectStub(
channel_->AddRoute(route_id, this, true);
// We retain the object just as PluginHost does if everything was in-process.
- NPN_RetainObject(npobject_);
+ WebBindings::retainObject(npobject_);
}
NPObjectStub::~NPObjectStub() {
@@ -37,7 +40,7 @@ NPObjectStub::~NPObjectStub() {
channel_->RemoveRoute(route_id_);
if (npobject_ && valid_)
- NPN_ReleaseObject(npobject_);
+ WebBindings::releaseObject(npobject_);
}
bool NPObjectStub::Send(IPC::Message* msg) {
@@ -103,7 +106,7 @@ void NPObjectStub::OnHasMethod(const NPIdentifier_Param& name,
*result = false;
}
} else {
- *result = NPN_HasMethod(0, npobject_, id);
+ *result = WebBindings::hasMethod(0, npobject_, id);
}
}
@@ -135,7 +138,7 @@ void NPObjectStub::OnInvoke(bool is_default,
return_value = false;
}
} else {
- return_value = NPN_InvokeDefault(
+ return_value = WebBindings::invokeDefault(
0, npobject_, args_var, arg_count, &result_var);
}
} else {
@@ -148,13 +151,13 @@ void NPObjectStub::OnInvoke(bool is_default,
return_value = false;
}
} else {
- return_value = NPN_Invoke(
+ return_value = WebBindings::invoke(
0, npobject_, id, args_var, arg_count, &result_var);
}
}
for (int i = 0; i < arg_count; ++i)
- NPN_ReleaseVariantValue(&(args_var[i]));
+ WebBindings::releaseVariantValue(&(args_var[i]));
delete[] args_var;
@@ -175,7 +178,7 @@ void NPObjectStub::OnHasProperty(const NPIdentifier_Param& name,
*result = false;
}
} else {
- *result = NPN_HasProperty(0, npobject_, id);
+ *result = WebBindings::hasProperty(0, npobject_, id);
}
}
@@ -193,7 +196,7 @@ void NPObjectStub::OnGetProperty(const NPIdentifier_Param& name,
*result = false;
}
} else {
- *result = NPN_GetProperty(0, npobject_, id, &result_var);
+ *result = WebBindings::getProperty(0, npobject_, id, &result_var);
}
CreateNPVariantParam(
@@ -217,10 +220,10 @@ void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name,
*result = false;
}
} else {
- *result = NPN_SetProperty(0, npobject_, id, &property_var);
+ *result = WebBindings::setProperty(0, npobject_, id, &property_var);
}
- NPN_ReleaseVariantValue(&property_var);
+ WebBindings::releaseVariantValue(&property_var);
}
void NPObjectStub::OnRemoveProperty(const NPIdentifier_Param& name,
@@ -233,7 +236,7 @@ void NPObjectStub::OnRemoveProperty(const NPIdentifier_Param& name,
*result = false;
}
} else {
- *result = NPN_RemoveProperty(0, npobject_, id);
+ *result = WebBindings::removeProperty(0, npobject_, id);
}
}
@@ -254,7 +257,7 @@ void NPObjectStub::OnEnumeration(std::vector<NPIdentifier_Param>* value,
NPIdentifier* value_np = NULL;
unsigned int count = 0;
if (!IsPluginProcess()) {
- *result = NPN_Enumerate(0, npobject_, &value_np, &count);
+ *result = WebBindings::enumerate(0, npobject_, &value_np, &count);
} else {
if (!npobject_->_class->enumerate) {
*result = false;
@@ -300,12 +303,12 @@ void NPObjectStub::OnConstruct(const std::vector<NPVariant_Param>& args,
return_value = false;
}
} else {
- return_value = NPN_Construct(
+ return_value = WebBindings::construct(
0, npobject_, args_var, arg_count, &result_var);
}
for (int i = 0; i < arg_count; ++i)
- NPN_ReleaseVariantValue(&(args_var[i]));
+ WebBindings::releaseVariantValue(&(args_var[i]));
delete[] args_var;
@@ -335,8 +338,8 @@ void NPObjectStub::OnEvaluate(const std::string& script,
script_string.UTF8Characters = script.c_str();
script_string.UTF8Length = static_cast<unsigned int>(script.length());
- bool return_value = NPN_EvaluateHelper(0, popups_allowed, npobject_,
- &script_string, &result_var);
+ bool return_value = WebBindings::evaluateHelper(0, popups_allowed, npobject_,
+ &script_string, &result_var);
NPVariant_Param result_param;
CreateNPVariantParam(
@@ -352,5 +355,5 @@ void NPObjectStub::OnSetException(const std::string& message) {
return;
}
- NPN_SetException(npobject_, message.c_str());
+ WebBindings::setException(npobject_, message.c_str());
}
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index a8a42b0..277ff91 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -18,10 +18,12 @@
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
#include "skia/ext/platform_device.h"
+#include "webkit/api/public/WebBindings.h"
#include "webkit/api/public/WebCursorInfo.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webplugin_delegate.h"
+using WebKit::WebBindings;
using WebKit::WebCursorInfo;
class FinishDestructionTask : public Task {
@@ -296,7 +298,7 @@ void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id,
page_url_);
// Release ref added by GetPluginScriptableObject (our stub holds its own).
- NPN_ReleaseObject(object);
+ WebBindings::releaseObject(object);
}
void WebPluginDelegateStub::OnSendJavaScriptStream(const std::string& url,
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 5b150581..8a27a57 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -23,12 +23,15 @@
#include "chrome/plugin/plugin_thread.h"
#include "chrome/plugin/webplugin_delegate_stub.h"
#include "skia/ext/platform_device.h"
+#include "webkit/api/public/WebBindings.h"
#include "webkit/glue/webplugin_delegate.h"
#if defined(OS_WIN)
#include "base/gfx/gdi_util.h"
#endif
+using WebKit::WebBindings;
+
typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap;
static ContextMap& GetContextMap() {
return *Singleton<ContextMap>::get();
@@ -153,7 +156,7 @@ void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) {
NPObject* WebPluginProxy::GetWindowScriptNPObject() {
if (window_npobject_)
- return NPN_RetainObject(window_npobject_);
+ return WebBindings::retainObject(window_npobject_);
int npobject_route_id = channel_->GenerateRouteID();
bool success = false;
@@ -172,7 +175,7 @@ NPObject* WebPluginProxy::GetWindowScriptNPObject() {
NPObject* WebPluginProxy::GetPluginElement() {
if (plugin_element_)
- return NPN_RetainObject(plugin_element_);
+ return WebBindings::retainObject(plugin_element_);
int npobject_route_id = channel_->GenerateRouteID();
bool success = false;
diff --git a/chrome/renderer/external_host_bindings.cc b/chrome/renderer/external_host_bindings.cc
index 108ee34..7aaf139 100644
--- a/chrome/renderer/external_host_bindings.cc
+++ b/chrome/renderer/external_host_bindings.cc
@@ -6,8 +6,11 @@
#include "base/values.h"
#include "chrome/common/render_messages.h"
+#include "webkit/api/public/WebBindings.h"
#include "webkit/glue/webframe.h"
+using WebKit::WebBindings;
+
ExternalHostBindings::ExternalHostBindings() : frame_(NULL) {
BindMethod("postMessage", &ExternalHostBindings::postMessage);
BindProperty("onmessage", &on_message_handler_);
@@ -96,7 +99,7 @@ bool ExternalHostBindings::ForwardMessageFromExternalHost(
NOTREACHED() << "CreateMessageEvent failed";
} else {
NPIdentifier init_message_event =
- NPN_GetStringIdentifier("initMessageEvent");
+ WebBindings::getStringIdentifier("initMessageEvent");
NPVariant init_args[8];
STRINGN_TO_NPVARIANT("message", sizeof("message") - 1,
init_args[0]); // type
@@ -112,22 +115,23 @@ bool ExternalHostBindings::ForwardMessageFromExternalHost(
NPVariant result;
NULL_TO_NPVARIANT(result);
- status = NPN_Invoke(NULL, event_obj, init_message_event, init_args,
- arraysize(init_args), &result);
+ status = WebBindings::invoke(NULL, event_obj, init_message_event, init_args,
+ arraysize(init_args), &result);
DCHECK(status) << "Failed to initialize MessageEvent";
- NPN_ReleaseVariantValue(&result);
+ WebBindings::releaseVariantValue(&result);
if (status) {
NPVariant event_arg;
OBJECT_TO_NPVARIANT(event_obj, event_arg);
- status = NPN_InvokeDefault(NULL, on_message_handler_.value.objectValue,
- &event_arg, 1, &result);
+ status = WebBindings::invokeDefault(NULL,
+ on_message_handler_.value.objectValue,
+ &event_arg, 1, &result);
// Don't DCHECK here in case the reason for the failure is a script error.
DLOG_IF(ERROR, !status) << "NPN_InvokeDefault failed";
- NPN_ReleaseVariantValue(&result);
+ WebBindings::releaseVariantValue(&result);
}
- NPN_ReleaseObject(event_obj);
+ WebBindings::releaseObject(event_obj);
}
return status;
@@ -149,11 +153,11 @@ bool ExternalHostBindings::CreateMessageEvent(NPObject** message_event) {
};
NPIdentifier identifiers[arraysize(identifier_names)] = {0};
- NPN_GetStringIdentifiers(identifier_names, arraysize(identifier_names),
- identifiers);
+ WebBindings::getStringIdentifiers(identifier_names,
+ arraysize(identifier_names), identifiers);
CppVariant document;
- bool ok = NPN_GetProperty(NULL, window, identifiers[0], &document);
+ bool ok = WebBindings::getProperty(NULL, window, identifiers[0], &document);
DCHECK(document.isObject());
bool success = false;
@@ -161,8 +165,8 @@ bool ExternalHostBindings::CreateMessageEvent(NPObject** message_event) {
NPVariant result, event_type;
STRINGN_TO_NPVARIANT("MessageEvent", sizeof("MessageEvent") - 1, \
event_type);
- success = NPN_Invoke(NULL, document.value.objectValue, identifiers[1],
- &event_type, 1, &result);
+ success = WebBindings::invoke(NULL, document.value.objectValue,
+ identifiers[1], &event_type, 1, &result);
DCHECK(!success || result.type == NPVariantType_Object);
if (result.type != NPVariantType_Object) {
DCHECK(success == false);
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 5e6ba7a..868be43 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -194,7 +194,7 @@ void WebPluginDelegateProxy::PluginDestroyed() {
// When we destroy the plugin instance, the NPObjectStub NULLs out its
// pointer to the npobject (see NPObjectStub::OnChannelError). Therefore,
// we release the object before destroying the instance to avoid leaking.
- NPN_ReleaseObject(npobject_);
+ WebBindings::releaseObject(npobject_);
npobject_ = NULL;
}
@@ -636,7 +636,7 @@ void WebPluginDelegateProxy::Print(gfx::NativeDrawingContext context) {
NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {
if (npobject_)
- return NPN_RetainObject(npobject_);
+ return WebBindings::retainObject(npobject_);
int route_id = MSG_ROUTING_NONE;
intptr_t npobject_ptr;
@@ -649,7 +649,7 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() {
channel_host_.get(), route_id, npobject_ptr,
render_view_->modal_dialog_event(), page_url_);
- return NPN_RetainObject(npobject_);
+ return WebBindings::retainObject(npobject_);
}
void WebPluginDelegateProxy::DidFinishLoadWithReason(NPReason reason) {
diff --git a/webkit/api/public/WebBindings.h b/webkit/api/public/WebBindings.h
index 00d055c..17af60f 100644
--- a/webkit/api/public/WebBindings.h
+++ b/webkit/api/public/WebBindings.h
@@ -44,17 +44,29 @@ namespace WebKit {
// NPN Functions ------------------------------------------------------
// These are all defined in npruntime.h and are well documented.
+ // NPN_Construct
+ WEBKIT_API static bool construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant* result);
+
// NPN_CreateObject
WEBKIT_API static NPObject* createObject(NPP npp, NPClass* npClass);
+ // NPN_Enumerate
+ WEBKIT_API static bool enumerate(NPP id, NPObject* obj, NPIdentifier** identifier, uint32_t* val);
+
+ // NPN_EvaluateHelper
+ WEBKIT_API static bool evaluateHelper(NPP npp, bool popups_allowed, NPObject* npobj, NPString* npscript, NPVariant* result);
+
// NPN_GetIntIdentifier
- WEBKIT_API static NPIdentifier getIntIdentifier(int32_t);
+ WEBKIT_API static NPIdentifier getIntIdentifier(int32_t number);
// NPN_GetProperty
WEBKIT_API static bool getProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, NPVariant *result);
// NPN_GetStringIdentifier
- WEBKIT_API static NPIdentifier getStringIdentifier(const NPUTF8*);
+ WEBKIT_API static NPIdentifier getStringIdentifier(const NPUTF8* string);
+
+ // NPN_GetStringIdentifiers
+ WEBKIT_API static void getStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers);
// NPN_HasMethod
WEBKIT_API static bool hasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName);
@@ -62,24 +74,45 @@ namespace WebKit {
// NPN_HasProperty
WEBKIT_API static bool hasProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName);
+ // NPN_IdentifierIsString
+ WEBKIT_API static bool identifierIsString(NPIdentifier identifier);
+
// NPN_InitializeVariantWithStringCopy (though sometimes prefixed with an underscore)
WEBKIT_API static void initializeVariantWithStringCopy(NPVariant* variant, const NPString* value);
+ // NPN_IntFromIdentifier
+ WEBKIT_API static int32_t intFromIdentifier(NPIdentifier identifier);
+
// NPN_Invoke
WEBKIT_API static bool invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result);
+ // NPN_InvokeDefault
+ WEBKIT_API static bool invokeDefault(NPP id, NPObject* obj, const NPVariant* args, uint32_t count, NPVariant* result);
+
// NPN_ReleaseObject
WEBKIT_API static void releaseObject(NPObject* npObject);
// NPN_ReleaseVariantValue
WEBKIT_API static void releaseVariantValue(NPVariant* variant);
+ // NPN_RemoveProperty
+ WEBKIT_API static bool removeProperty(NPP id, NPObject* object, NPIdentifier identifier);
+
// NPN_RetainObject
WEBKIT_API static NPObject* retainObject(NPObject* npObject);
+ // NPN_SetException
+ WEBKIT_API static void setException(NPObject* obj, const NPUTF8* message);
+
+ // NPN_SetProperty
+ WEBKIT_API static bool setProperty(NPP id, NPObject* obj, NPIdentifier identifier, const NPVariant* variant);
+
// _NPN_UnregisterObject
WEBKIT_API static void unregisterObject(NPObject* npObject);
+ // NPN_UTF8FromIdentifier
+ WEBKIT_API static NPUTF8* utf8FromIdentifier(NPIdentifier identifier);
+
// Miscellaneous utility functions ------------------------------------
// Complement to NPN_Get___Identifier functions. Extracts data from the NPIdentifier data
diff --git a/webkit/api/src/WebBindings.cpp b/webkit/api/src/WebBindings.cpp
index b3cf59a..8e725e4 100644
--- a/webkit/api/src/WebBindings.cpp
+++ b/webkit/api/src/WebBindings.cpp
@@ -54,11 +54,26 @@ using namespace WebCore;
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);
+}
+
NPObject* WebBindings::createObject(NPP npp, NPClass* 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);
+}
+
+bool WebBindings::evaluateHelper(NPP npp, bool popups_allowed, NPObject* npobj, NPString* npscript, NPVariant* result)
+{
+ return NPN_EvaluateHelper(npp, popups_allowed, npobj, npscript, result);
+}
+
NPIdentifier WebBindings::getIntIdentifier(int32_t number)
{
return NPN_GetIntIdentifier(number);
@@ -74,6 +89,11 @@ NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string)
return NPN_GetStringIdentifier(string);
}
+void WebBindings::getStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier* identifiers)
+{
+ NPN_GetStringIdentifiers(names, nameCount, identifiers);
+}
+
bool WebBindings::hasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName)
{
return NPN_HasMethod(npp, npObject, methodName);
@@ -84,6 +104,16 @@ bool WebBindings::hasProperty(NPP npp, NPObject* npObject, NPIdentifier property
return NPN_HasProperty(npp, npObject, propertyName);
}
+bool WebBindings::identifierIsString(NPIdentifier identifier)
+{
+ return NPN_IdentifierIsString(identifier);
+}
+
+int32_t WebBindings::intFromIdentifier(NPIdentifier identifier)
+{
+ return NPN_IntFromIdentifier(identifier);
+}
+
void WebBindings::initializeVariantWithStringCopy(NPVariant* variant, const NPString* value)
{
#if USE(V8)
@@ -98,6 +128,11 @@ bool WebBindings::invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, c
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);
+}
+
void WebBindings::releaseObject(NPObject* npObject)
{
return NPN_ReleaseObject(npObject);
@@ -108,11 +143,26 @@ void WebBindings::releaseVariantValue(NPVariant* variant)
NPN_ReleaseVariantValue(variant);
}
+bool WebBindings::removeProperty(NPP id, NPObject* object, NPIdentifier identifier)
+{
+ return NPN_RemoveProperty(id, object, identifier);
+}
+
NPObject* WebBindings::retainObject(NPObject* npObject)
{
return NPN_RetainObject(npObject);
}
+void WebBindings::setException(NPObject* obj, const NPUTF8* message)
+{
+ NPN_SetException(obj, message);
+}
+
+bool WebBindings::setProperty(NPP id, NPObject* obj, NPIdentifier identifier, const NPVariant* variant)
+{
+ return NPN_SetProperty(id, obj, identifier, variant);
+}
+
void WebBindings::unregisterObject(NPObject* npObject)
{
#if USE(V8)
@@ -120,6 +170,11 @@ void WebBindings::unregisterObject(NPObject* npObject)
#endif
}
+NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier)
+{
+ return NPN_UTF8FromIdentifier(identifier);
+}
+
void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NPUTF8*& string, int32_t& number, bool& isString)
{
PrivateIdentifier* priv = static_cast<PrivateIdentifier*>(identifier);