summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
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 /chrome/plugin
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
Diffstat (limited to 'chrome/plugin')
-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
4 files changed, 31 insertions, 21 deletions
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;