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

Unified Diff: content/renderer/java/gin_java_bridge_object.h

Issue 969353004: [Android] Cache function templates in GinJavaBridgeObject to avoid memory leak (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | content/renderer/java/gin_java_bridge_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/java/gin_java_bridge_object.h
diff --git a/content/renderer/java/gin_java_bridge_object.h b/content/renderer/java/gin_java_bridge_object.h
index 5c729b891a8e10220c285c1eebd6b3aa9458445d..e119c88e311166f6a862a76cd7bef37f75c18022 100644
--- a/content/renderer/java/gin_java_bridge_object.h
+++ b/content/renderer/java/gin_java_bridge_object.h
@@ -14,6 +14,7 @@
#include "gin/interceptor.h"
#include "gin/object_template_builder.h"
#include "gin/wrappable.h"
+#include "v8/include/v8-util.h"
namespace blink {
class WebFrame;
@@ -55,6 +56,8 @@ class GinJavaBridgeObject : public gin::Wrappable<GinJavaBridgeObject>,
GinJavaBridgeDispatcher::ObjectID object_id);
~GinJavaBridgeObject() override;
+ v8::Local<v8::FunctionTemplate> GetFunctionTemplate(v8::Isolate* isolate,
+ const std::string& name);
v8::Handle<v8::Value> InvokeMethod(const std::string& name,
gin::Arguments* args);
@@ -62,6 +65,7 @@ class GinJavaBridgeObject : public gin::Wrappable<GinJavaBridgeObject>,
GinJavaBridgeDispatcher::ObjectID object_id_;
scoped_ptr<GinJavaBridgeValueConverter> converter_;
std::map<std::string, bool> known_methods_;
+ v8::StdPersistentValueMap<std::string, v8::FunctionTemplate> template_cache_;
DISALLOW_COPY_AND_ASSIGN(GinJavaBridgeObject);
};
« no previous file with comments | « no previous file | content/renderer/java/gin_java_bridge_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698