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

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

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix skipped comment 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
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/mojo.h"
6
7 #include "gin/converter.h"
8 #include "gin/per_isolate_data.h"
9 #include "gin/wrapper_info.h"
10 #include "mojo/public/bindings/js/core.h"
11
12 namespace mojo {
13 namespace js {
14
15 namespace {
16
17 gin::WrapperInfo g_mojo_wrapper_info = {};
18
19 }
20
21 v8::Local<v8::ObjectTemplate> GetMojoTemplate(v8::Isolate* isolate) {
22 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
23 v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(
24 &g_mojo_wrapper_info);
25 if (templ.IsEmpty()) {
26 templ = v8::ObjectTemplate::New();
27 templ->Set(gin::StringToSymbol(isolate, "core"), GetCoreTemplate(isolate));
28 data->SetObjectTemplate(&g_mojo_wrapper_info, templ);
29 }
30 return templ;
31 }
32
33 } // namespace js
34 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698