summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/npapi/plugin_host.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc
index 52c2a96..7bea68b 100644
--- a/webkit/plugins/npapi/plugin_host.cc
+++ b/webkit/plugins/npapi/plugin_host.cc
@@ -292,24 +292,17 @@ using webkit::npapi::WebPlugin;
// Allocates memory from the host's memory space.
void* NPN_MemAlloc(uint32_t size) {
- scoped_refptr<PluginHost> host(PluginHost::Singleton());
- if (host != NULL) {
- // Note: We must use the same allocator/deallocator
- // that is used by the javascript library, as some of the
- // JS APIs will pass memory to the plugin which the plugin
- // will attempt to free.
- return malloc(size);
- }
- return NULL;
+ // Note: We must use the same allocator/deallocator
+ // that is used by the javascript library, as some of the
+ // JS APIs will pass memory to the plugin which the plugin
+ // will attempt to free.
+ return malloc(size);
}
// Deallocates memory from the host's memory space
void NPN_MemFree(void* ptr) {
- scoped_refptr<PluginHost> host(PluginHost::Singleton());
- if (host != NULL) {
- if (ptr != NULL && ptr != reinterpret_cast<void*>(-1))
- free(ptr);
- }
+ if (ptr != NULL && ptr != reinterpret_cast<void*>(-1))
+ free(ptr);
}
// Requests that the host free a specified amount of memory.