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

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

Issue 974183005: Cache locally function templates returned by gin::CreateFunctionTemplate (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/pepper/message_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/message_channel.h
diff --git a/content/renderer/pepper/message_channel.h b/content/renderer/pepper/message_channel.h
index 4889777ed76de51152bb7b6a3030fe9660ac993e..c3776e922169787c92fada71ef436221917f5d24 100644
--- a/content/renderer/pepper/message_channel.h
+++ b/content/renderer/pepper/message_channel.h
@@ -18,6 +18,7 @@
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/shared_impl/resource.h"
#include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
+#include "v8/include/v8-util.h"
#include "v8/include/v8.h"
struct PP_Var;
@@ -142,6 +143,11 @@ class MessageChannel :
void UnregisterSyncMessageStatusObserver();
+ v8::Local<v8::FunctionTemplate> GetFunctionTemplate(
+ v8::Isolate* isolate,
+ const std::string& name,
+ void (MessageChannel::*memberFuncPtr)(gin::Arguments* args));
+
PepperPluginInstanceImpl* instance_;
// We pass all non-postMessage calls through to the passthrough_object_.
@@ -186,6 +192,8 @@ class MessageChannel :
// Observers for sync messages.
base::Closure unregister_observer_callback_;
+ v8::StdPersistentValueMap<std::string, v8::FunctionTemplate> template_cache_;
+
// This is used to ensure pending tasks will not fire after this object is
// destroyed.
base::WeakPtrFactory<MessageChannel> weak_ptr_factory_;
« no previous file with comments | « no previous file | content/renderer/pepper/message_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698