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

Side by Side Diff: mojo/public/bindings/js/global.cc

Issue 69843003: Implement Mojo message codec in JavaScript (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/public/bindings/js/global.h ('k') | mojo/public/bindings/js/runner_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/bindings/js/global.h"
6
7 #include "gin/modules/module_registry.h"
8 #include "gin/per_isolate_data.h"
9 #include "gin/wrapper_info.h"
10
11 namespace mojo {
12 namespace js {
13
14 namespace {
15
16 gin::WrapperInfo g_wrapper_info = {};
17
18 }
19
20 v8::Local<v8::ObjectTemplate> GetGlobalTemplate(v8::Isolate* isolate) {
21 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
22 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
23 &g_wrapper_info);
24 if (templ.IsEmpty()) {
25 templ = v8::ObjectTemplate::New();
26 gin::ModuleRegistry::RegisterGlobals(isolate, templ);
27 data->SetObjectTemplate(&g_wrapper_info, templ);
28 }
29 return templ;
30 }
31
32 } // namespace js
33 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/bindings/js/global.h ('k') | mojo/public/bindings/js/runner_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698