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 "gin/modules/module_runner_delegate.h" |
| 6 |
| 7 #include "gin/modules/module_registry.h" |
| 8 |
| 9 namespace gin { |
| 10 |
| 11 ModuleRunnerDelegate::ModuleRunnerDelegate(const base::FilePath& module_base) |
| 12 : module_provider_(module_base) { |
| 13 } |
| 14 |
| 15 ModuleRunnerDelegate::~ModuleRunnerDelegate() { |
| 16 } |
| 17 |
| 18 v8::Handle<v8::ObjectTemplate> ModuleRunnerDelegate::GetGlobalTemplate( |
| 19 Runner* runner) { |
| 20 v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(); |
| 21 ModuleRegistry::RegisterGlobals(runner->isolate(), templ); |
| 22 return templ; |
| 23 } |
| 24 |
| 25 void ModuleRunnerDelegate::DidRunScript(Runner* runner, |
| 26 v8::Handle<v8::Script> script) { |
| 27 ModuleRegistry* registry = ModuleRegistry::From(runner->context()); |
| 28 registry->AttemptToLoadMoreModules(runner->isolate()); |
| 29 module_provider_.AttempToLoadModules( |
| 30 runner, registry->unsatisfied_dependencies()); |
| 31 } |
| 32 |
| 33 } // namespace gin |
OLD | NEW |