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

Unified Diff: gin/modules/module_runner_delegate.cc

Issue 74753002: Introduce gin_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits 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 side-by-side diff with in-line comments
Download patch
Index: gin/modules/module_runner_delegate.cc
diff --git a/gin/modules/module_runner_delegate.cc b/gin/modules/module_runner_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e029a93fda8c0feed797ffc1124dd1f474e976df
--- /dev/null
+++ b/gin/modules/module_runner_delegate.cc
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gin/modules/module_runner_delegate.h"
+
+#include "gin/modules/module_registry.h"
+
+namespace gin {
+
+ModuleRunnerDelegate::ModuleRunnerDelegate(const base::FilePath& module_base)
+ : module_provider_(module_base) {
+}
+
+ModuleRunnerDelegate::~ModuleRunnerDelegate() {
+}
+
+v8::Handle<v8::ObjectTemplate> ModuleRunnerDelegate::GetGlobalTemplate(
+ Runner* runner) {
+ v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
+ ModuleRegistry::RegisterGlobals(runner->isolate(), templ);
+ return templ;
+}
+
+void ModuleRunnerDelegate::DidRunScript(Runner* runner,
+ v8::Handle<v8::Script> script) {
+ ModuleRegistry* registry = ModuleRegistry::From(runner->context());
+ registry->AttemptToLoadMoreModules(runner->isolate());
+ module_provider_.AttempToLoadModules(
+ runner, registry->unsatisfied_dependencies());
+}
+
+} // namespace gin

Powered by Google App Engine
This is Rietveld 408576698