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

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: Moar copyright 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> MojoTemplate(v8::Isolate* isolate) {
22 gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
23 v8::Local<v8::ObjectTemplate> templ;
24 if (!data->GetObjectTemplate(&g_mojo_wrapper_info, &templ)) {
25 templ = v8::ObjectTemplate::New();
26 templ->Set(gin::StringToV8(isolate, "core"), CoreTemplate(isolate));
Aaron Boodman 2013/11/11 19:01:08 Do you want to use symbols for these static string
abarth-chromium 2013/11/11 20:17:42 Yes. I'll add a gin::StringToSymbol function.
27 data->RegisterObjectTemplate(&g_mojo_wrapper_info, templ);
28 }
29 return templ;
30 }
31
32 } // namespace js
33 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698