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

Unified Diff: gin/modules/module_runner_delegate.cc

Issue 179803007: Refactors parts of gin: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gin_shell Created 6 years, 10 months 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
« no previous file with comments | « gin/modules/module_runner_delegate.h ('k') | gin/modules/timer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/modules/module_runner_delegate.cc
diff --git a/gin/modules/module_runner_delegate.cc b/gin/modules/module_runner_delegate.cc
index 2a9f95cd760575e7be135d2f7f2c4b6482cdcaaf..16b5afd0303ba8a8819cbe54aef25ec8c4c24a84 100644
--- a/gin/modules/module_runner_delegate.cc
+++ b/gin/modules/module_runner_delegate.cc
@@ -6,6 +6,7 @@
#include "gin/modules/module_registry.h"
#include "gin/object_template_builder.h"
+#include "gin/public/context_holder.h"
namespace gin {
@@ -23,34 +24,35 @@ void ModuleRunnerDelegate::AddBuiltinModule(const std::string& id,
}
void ModuleRunnerDelegate::AttemptToLoadMoreModules(Runner* runner) {
- ModuleRegistry* registry = ModuleRegistry::From(runner->context());
- registry->AttemptToLoadMoreModules(runner->isolate());
+ ModuleRegistry* registry = ModuleRegistry::From(
+ runner->GetContextHolder()->context());
+ registry->AttemptToLoadMoreModules(runner->GetContextHolder()->isolate());
module_provider_.AttempToLoadModules(
runner, registry->unsatisfied_dependencies());
}
v8::Handle<v8::ObjectTemplate> ModuleRunnerDelegate::GetGlobalTemplate(
- Runner* runner) {
- v8::Handle<v8::ObjectTemplate> templ =
- ObjectTemplateBuilder(runner->isolate()).Build();
- ModuleRegistry::RegisterGlobals(runner->isolate(), templ);
+ ShellRunner* runner,
+ v8::Isolate* isolate) {
+ v8::Handle<v8::ObjectTemplate> templ = ObjectTemplateBuilder(isolate).Build();
+ ModuleRegistry::RegisterGlobals(isolate, templ);
return templ;
}
-void ModuleRunnerDelegate::DidCreateContext(Runner* runner) {
- RunnerDelegate::DidCreateContext(runner);
+void ModuleRunnerDelegate::DidCreateContext(ShellRunner* runner) {
+ ShellRunnerDelegate::DidCreateContext(runner);
- v8::Handle<v8::Context> context = runner->context();
+ v8::Handle<v8::Context> context = runner->GetContextHolder()->context();
ModuleRegistry* registry = ModuleRegistry::From(context);
+ v8::Isolate* isolate = runner->GetContextHolder()->isolate();
for (BuiltinModuleMap::const_iterator it = builtin_modules_.begin();
it != builtin_modules_.end(); ++it) {
- registry->AddBuiltinModule(runner->isolate(), it->first,
- it->second(runner->isolate()));
+ registry->AddBuiltinModule(isolate, it->first, it->second(isolate));
}
}
-void ModuleRunnerDelegate::DidRunScript(Runner* runner) {
+void ModuleRunnerDelegate::DidRunScript(ShellRunner* runner) {
AttemptToLoadMoreModules(runner);
}
« no previous file with comments | « gin/modules/module_runner_delegate.h ('k') | gin/modules/timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698