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

Unified Diff: content/renderer/pepper/plugin_object.h

Issue 785213002: Cache function templates in PluginObject to avoid memory leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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 | content/renderer/pepper/plugin_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/plugin_object.h
diff --git a/content/renderer/pepper/plugin_object.h b/content/renderer/pepper/plugin_object.h
index 4dec6205d5830f14d31d0b2a93de95f291716e62..f13fcd3570603872c16a098ca787b9d4a36ad63a 100644
--- a/content/renderer/pepper/plugin_object.h
+++ b/content/renderer/pepper/plugin_object.h
@@ -12,6 +12,7 @@
#include "gin/interceptor.h"
#include "gin/wrappable.h"
#include "ppapi/c/pp_var.h"
+#include "v8/include/v8-util.h"
struct PPP_Class_Deprecated;
@@ -75,6 +76,9 @@ class PluginObject : public gin::Wrappable<PluginObject>,
void Call(const std::string& identifier, gin::Arguments* args);
+ v8::Local<v8::FunctionTemplate> GetFunctionTemplate(v8::Isolate* isolate,
+ const std::string& name);
+
PepperPluginInstanceImpl* instance_;
const PPP_Class_Deprecated* ppp_class_;
@@ -82,6 +86,8 @@ class PluginObject : public gin::Wrappable<PluginObject>,
base::WeakPtrFactory<PluginObject> weak_factory_;
+ v8::StdPersistentValueMap<std::string, v8::FunctionTemplate> template_cache_;
+
DISALLOW_COPY_AND_ASSIGN(PluginObject);
};
« no previous file with comments | « no previous file | content/renderer/pepper/plugin_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698