Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: webkit/plugins/npapi/plugin_host.cc

Issue 6134001: Fix for a plugin crasher which occurs in the context of NPP_Destroy. The plug... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/plugin_host.cc
===================================================================
--- webkit/plugins/npapi/plugin_host.cc (revision 70377)
+++ webkit/plugins/npapi/plugin_host.cc (working copy)
@@ -292,24 +292,17 @@
// 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698