Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |