OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/public/bindings/js/runner_delegate.h" | 5 #include "mojo/public/bindings/js/runner_delegate.h" |
6 | 6 |
7 #include "mojo/public/bindings/js/mojo.h" | 7 #include "gin/modules/module_registry.h" |
| 8 #include "mojo/public/bindings/js/core.h" |
| 9 #include "mojo/public/bindings/js/global.h" |
8 | 10 |
9 namespace mojo { | 11 namespace mojo { |
10 namespace js { | 12 namespace js { |
11 | 13 |
12 RunnerDelegate::RunnerDelegate() { | 14 RunnerDelegate::RunnerDelegate() { |
13 } | 15 } |
14 | 16 |
15 RunnerDelegate::~RunnerDelegate() { | 17 RunnerDelegate::~RunnerDelegate() { |
16 } | 18 } |
17 | 19 |
18 v8::Handle<v8::Object> RunnerDelegate::CreateRootObject(gin::Runner* runner) { | 20 v8::Handle<v8::ObjectTemplate> RunnerDelegate::GetGlobalTemplate( |
19 return GetMojoTemplate(runner->isolate())->NewInstance(); | 21 gin::Runner* runner) { |
| 22 return js::GetGlobalTemplate(runner->isolate()); |
| 23 } |
| 24 |
| 25 void RunnerDelegate::DidCreateContext(gin::Runner* runner) { |
| 26 v8::Handle<v8::Context> context = runner->context(); |
| 27 gin::ModuleRegistry* registry = |
| 28 gin::ModuleRegistry::From(context); |
| 29 |
| 30 registry->AddBuiltinModule(runner->isolate(), "core", |
| 31 GetCoreTemplate(runner->isolate())); |
20 } | 32 } |
21 | 33 |
22 } // namespace js | 34 } // namespace js |
23 } // namespace mojo | 35 } // namespace mojo |
OLD | NEW |