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

Unified Diff: mojo/public/bindings/js/global.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/global.h ('k') | mojo/public/bindings/js/mojo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/js/global.cc
diff --git a/mojo/public/bindings/js/mojo.cc b/mojo/public/bindings/js/global.cc
similarity index 58%
rename from mojo/public/bindings/js/mojo.cc
rename to mojo/public/bindings/js/global.cc
index a380bb65a1ed40c6f7f9276d37b0e8c27aaf39da..e0187bf33e9262f7a2dff4334e6d6b8ff2d48b2e 100644
--- a/mojo/public/bindings/js/mojo.cc
+++ b/mojo/public/bindings/js/global.cc
@@ -2,30 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/public/bindings/js/mojo.h"
+#include "mojo/public/bindings/js/global.h"
-#include "gin/converter.h"
+#include "gin/modules/module_registry.h"
#include "gin/per_isolate_data.h"
#include "gin/wrapper_info.h"
-#include "mojo/public/bindings/js/core.h"
namespace mojo {
namespace js {
namespace {
-gin::WrapperInfo g_mojo_wrapper_info = {};
+gin::WrapperInfo g_wrapper_info = {};
}
-v8::Local<v8::ObjectTemplate> GetMojoTemplate(v8::Isolate* isolate) {
+v8::Local<v8::ObjectTemplate> GetGlobalTemplate(v8::Isolate* isolate) {
gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
- &g_mojo_wrapper_info);
+ &g_wrapper_info);
if (templ.IsEmpty()) {
templ = v8::ObjectTemplate::New();
- templ->Set(gin::StringToSymbol(isolate, "core"), GetCoreTemplate(isolate));
- data->SetObjectTemplate(&g_mojo_wrapper_info, templ);
+ gin::ModuleRegistry::RegisterGlobals(isolate, templ);
+ data->SetObjectTemplate(&g_wrapper_info, templ);
}
return templ;
}
« no previous file with comments | « mojo/public/bindings/js/global.h ('k') | mojo/public/bindings/js/mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698