diff options
author | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 22:23:16 +0000 |
---|---|---|
committer | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 22:23:16 +0000 |
commit | dac8dead45f48de10e1401bb2f9b01e266163995 (patch) | |
tree | ef3622ba5622038869dad2b393dad826f40f9d60 /content | |
parent | 5f6f7f25502d4de4fc2be2c9bd28ee6f8bbc06ee (diff) | |
download | chromium_src-dac8dead45f48de10e1401bb2f9b01e266163995.zip chromium_src-dac8dead45f48de10e1401bb2f9b01e266163995.tar.gz chromium_src-dac8dead45f48de10e1401bb2f9b01e266163995.tar.bz2 |
Shim calls to NPN_MemAlloc/MemFree through PluginHost
This change is necessary so that content doesn't attempt to call NPN_*
functions directly; this will be impossible once glue is a separate
component.
R=jam@chromium.org
BUG=98755
TEST=waterfall stays green
Review URL: http://codereview.chromium.org/8741005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/common/npobject_proxy.cc | 4 | ||||
-rw-r--r-- | content/common/npobject_stub.cc | 3 | ||||
-rw-r--r-- | content/public/common/webkit_param_traits.cc | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/content/common/npobject_proxy.cc b/content/common/npobject_proxy.cc index 4a37611..0ee801c 100644 --- a/content/common/npobject_proxy.cc +++ b/content/common/npobject_proxy.cc @@ -10,6 +10,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" #include "webkit/glue/webkit_glue.h" #include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_host.h" using WebKit::WebBindings; @@ -384,7 +385,8 @@ bool NPObjectProxy::NPNEnumerate(NPObject *obj, *count = static_cast<unsigned int>(value_param.size()); *value = static_cast<NPIdentifier *>( - NPN_MemAlloc(sizeof(NPIdentifier) * *count)); + webkit::npapi::PluginHost::Singleton()->host_functions()->memalloc( + sizeof(NPIdentifier) * *count)); for (unsigned int i = 0; i < *count; ++i) (*value)[i] = CreateNPIdentifier(value_param[i]); diff --git a/content/common/npobject_stub.cc b/content/common/npobject_stub.cc index c8e16a7..19474b4 100644 --- a/content/common/npobject_stub.cc +++ b/content/common/npobject_stub.cc @@ -14,6 +14,7 @@ #include "third_party/npapi/bindings/npruntime.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" #include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_host.h" using WebKit::WebBindings; @@ -324,7 +325,7 @@ void NPObjectStub::OnEnumeration(std::vector<NPIdentifier_Param>* value, value->push_back(param); } - NPN_MemFree(value_np); + webkit::npapi::PluginHost::Singleton()->host_functions()->memfree(value_np); } void NPObjectStub::OnConstruct(const std::vector<NPVariant_Param>& args, diff --git a/content/public/common/webkit_param_traits.cc b/content/public/common/webkit_param_traits.cc index 0a75396..96a0ba4f 100644 --- a/content/public/common/webkit_param_traits.cc +++ b/content/public/common/webkit_param_traits.cc @@ -13,6 +13,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebBindings.h" #include "webkit/glue/password_form.h" #include "webkit/glue/resource_loader_bridge.h" +#include "webkit/plugins/npapi/plugin_host.h" NPIdentifier_Param::NPIdentifier_Param() : identifier() { @@ -234,7 +235,7 @@ void ParamTraits<NPIdentifier_Param>::Log(const param_type& p, std::string* l) { if (WebKit::WebBindings::identifierIsString(p.identifier)) { NPUTF8* str = WebKit::WebBindings::utf8FromIdentifier(p.identifier); l->append(str); - NPN_MemFree(str); + webkit::npapi::PluginHost::Singleton()->host_functions()->memfree(str); } else { l->append(base::IntToString( WebKit::WebBindings::intFromIdentifier(p.identifier))); |