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

Unified Diff: gin/modules/module_runner_delegate.h

Issue 467263006: JavaScript Content Handler Version 0.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | « no previous file | gin/modules/module_runner_delegate.cc » ('j') | mojo/apps/js/js_app.cc » ('J')
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 09d4582dd76684ac420619104e6426f7de25203c..df91f6358b12994ae5f93d58089f0f651e171aa4 100644
--- a/gin/modules/module_runner_delegate.h
+++ b/gin/modules/module_runner_delegate.h
@@ -7,14 +7,17 @@
#include <map>
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "gin/gin_export.h"
#include "gin/modules/file_module_provider.h"
#include "gin/shell_runner.h"
+#include "v8/include/v8.h"
namespace gin {
typedef v8::Local<v8::Value> (*ModuleGetter)(v8::Isolate* isolate);
+typedef base::Callback<v8::Local<v8::Value>(v8::Isolate*)> ModuleGetterCallback;
// Emebedders that use AMD modules will probably want to use a RunnerDelegate
// that inherits from ModuleRunnerDelegate. ModuleRunnerDelegate lets embedders
@@ -26,12 +29,14 @@ class GIN_EXPORT ModuleRunnerDelegate : public ShellRunnerDelegate {
virtual ~ModuleRunnerDelegate();
void AddBuiltinModule(const std::string& id, ModuleGetter getter);
+ void AddBuiltinModule(const std::string& id,
+ const ModuleGetterCallback& getter);
protected:
void AttemptToLoadMoreModules(Runner* runner);
private:
- typedef std::map<std::string, ModuleGetter> BuiltinModuleMap;
+ typedef std::map<std::string, ModuleGetterCallback> BuiltinModuleMap;
// From ShellRunnerDelegate:
virtual v8::Handle<v8::ObjectTemplate> GetGlobalTemplate(
« no previous file with comments | « no previous file | gin/modules/module_runner_delegate.cc » ('j') | mojo/apps/js/js_app.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698