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

Unified Diff: gin/per_isolate_data.cc

Issue 62333018: Implement Asynchronous Module Definition API for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Aaron's comments Created 7 years, 1 month 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 | « gin/per_isolate_data.h ('k') | gin/runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/per_isolate_data.cc
diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc
index 56b2c533fb08ca2c7ca86c2f6662a54f51801a89..b18a89ad9587dced684ce4d6b406d1ac45943b1d 100644
--- a/gin/per_isolate_data.cc
+++ b/gin/per_isolate_data.cc
@@ -9,6 +9,7 @@ using v8::Handle;
using v8::Isolate;
using v8::Local;
using v8::Object;
+using v8::FunctionTemplate;
using v8::ObjectTemplate;
namespace gin {
@@ -30,6 +31,11 @@ void PerIsolateData::SetObjectTemplate(WrapperInfo* info,
object_templates_[info] = Eternal<ObjectTemplate>(isolate_, templ);
}
+void PerIsolateData::SetFunctionTemplate(WrapperInfo* info,
+ Local<FunctionTemplate> templ) {
+ function_templates_[info] = Eternal<FunctionTemplate>(isolate_, templ);
+}
+
v8::Local<v8::ObjectTemplate> PerIsolateData::GetObjectTemplate(
WrapperInfo* info) {
ObjectTemplateMap::iterator it = object_templates_.find(info);
@@ -38,4 +44,12 @@ v8::Local<v8::ObjectTemplate> PerIsolateData::GetObjectTemplate(
return it->second.Get(isolate_);
}
+v8::Local<v8::FunctionTemplate> PerIsolateData::GetFunctionTemplate(
+ WrapperInfo* info) {
+ FunctionTemplateMap::iterator it = function_templates_.find(info);
+ if (it == function_templates_.end())
+ return v8::Local<v8::FunctionTemplate>();
+ return it->second.Get(isolate_);
+}
+
} // namespace gin
« no previous file with comments | « gin/per_isolate_data.h ('k') | gin/runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698