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

Unified Diff: mojo/public/bindings/js/runner_delegate.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 | « mojo/public/bindings/js/runner_delegate.h ('k') | mojo/public/bindings/js/test/harness.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/js/runner_delegate.cc
diff --git a/mojo/public/bindings/js/runner_delegate.cc b/mojo/public/bindings/js/runner_delegate.cc
index f990caa9b4844382c73d2242e2782bcc4310a0f5..79203cbef0aca2e3d65ca164fbb8515182443cf0 100644
--- a/mojo/public/bindings/js/runner_delegate.cc
+++ b/mojo/public/bindings/js/runner_delegate.cc
@@ -4,7 +4,9 @@
#include "mojo/public/bindings/js/runner_delegate.h"
-#include "mojo/public/bindings/js/mojo.h"
+#include "gin/modules/module_registry.h"
+#include "mojo/public/bindings/js/core.h"
+#include "mojo/public/bindings/js/global.h"
namespace mojo {
namespace js {
@@ -15,8 +17,18 @@ RunnerDelegate::RunnerDelegate() {
RunnerDelegate::~RunnerDelegate() {
}
-v8::Handle<v8::Object> RunnerDelegate::CreateRootObject(gin::Runner* runner) {
- return GetMojoTemplate(runner->isolate())->NewInstance();
+v8::Handle<v8::ObjectTemplate> RunnerDelegate::GetGlobalTemplate(
+ gin::Runner* runner) {
+ return js::GetGlobalTemplate(runner->isolate());
+}
+
+void RunnerDelegate::DidCreateContext(gin::Runner* runner) {
+ v8::Handle<v8::Context> context = runner->context();
+ gin::ModuleRegistry* registry =
+ gin::ModuleRegistry::From(context);
+
+ registry->AddBuiltinModule(runner->isolate(), "core",
+ GetCoreTemplate(runner->isolate()));
}
} // namespace js
« no previous file with comments | « mojo/public/bindings/js/runner_delegate.h ('k') | mojo/public/bindings/js/test/harness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698