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

Unified Diff: gin/modules/module_runner_delegate.h

Issue 69843003: Implement Mojo message codec in JavaScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Aaron's comments 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
« no previous file with comments | « gin/modules/module_registry.cc ('k') | gin/modules/module_runner_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/modules/module_runner_delegate.h
diff --git a/gin/modules/module_runner_delegate.h b/gin/modules/module_runner_delegate.h
index f16596ea5d3266f834ed572d5c64c58f0d21ea01..4d821d2735b5cf32569357abea6ddf2db2428122 100644
--- a/gin/modules/module_runner_delegate.h
+++ b/gin/modules/module_runner_delegate.h
@@ -5,24 +5,35 @@
#ifndef GIN_MODULES_MODULE_RUNNER_DELEGATE_H_
#define GIN_MODULES_MODULE_RUNNER_DELEGATE_H_
+#include <map>
+
#include "base/compiler_specific.h"
#include "gin/modules/file_module_provider.h"
#include "gin/runner.h"
namespace gin {
+typedef v8::Local<v8::ObjectTemplate> (*ModuleTemplateGetter)(
+ v8::Isolate* isolate);
+
class ModuleRunnerDelegate : public RunnerDelegate {
public:
explicit ModuleRunnerDelegate(const base::FilePath& module_base);
virtual ~ModuleRunnerDelegate();
+ void AddBuiltinModule(const std::string& id, ModuleTemplateGetter templ);
+
private:
+ typedef std::map<std::string, ModuleTemplateGetter> BuiltinModuleMap;
+
// From RunnerDelegate:
virtual v8::Handle<v8::ObjectTemplate> GetGlobalTemplate(
Runner* runner) OVERRIDE;
+ virtual void DidCreateContext(Runner* runner) OVERRIDE;
virtual void DidRunScript(Runner* runner,
v8::Handle<v8::Script> script) OVERRIDE;
+ BuiltinModuleMap builtin_modules_;
FileModuleProvider module_provider_;
DISALLOW_COPY_AND_ASSIGN(ModuleRunnerDelegate);
« no previous file with comments | « gin/modules/module_registry.cc ('k') | gin/modules/module_runner_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698