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

Unified Diff: extensions/renderer/script_context.h

Issue 359413004: Add support for using AMD modules from extensions modules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cross-context tests Created 6 years, 5 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
Index: extensions/renderer/script_context.h
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h
index 26002ec8eea761218c8da745b4fbbb0f005d2b01..7b19ac14dc0864b120a3c9eed3804096f4c768e9 100644
--- a/extensions/renderer/script_context.h
+++ b/extensions/renderer/script_context.h
@@ -14,6 +14,7 @@
#include "extensions/renderer/request_sender.h"
#include "extensions/renderer/safe_builtins.h"
#include "extensions/renderer/scoped_persistent.h"
+#include "gin/runner.h"
#include "v8/include/v8.h"
namespace blink {
@@ -28,7 +29,7 @@ namespace extensions {
class Extension;
// Extensions wrapper for a v8 context.
-class ScriptContext : public RequestSender::Source {
+class ScriptContext : public RequestSender::Source, public gin::Runner {
public:
ScriptContext(const v8::Handle<v8::Context>& context,
blink::WebFrame* frame,
@@ -120,6 +121,15 @@ class ScriptContext : public RequestSender::Source {
const base::ListValue& response,
const std::string& error) OVERRIDE;
+ // gin::Runner overrides.
+ virtual void Run(const std::string& source,
+ const std::string& resource_name) OVERRIDE;
+ virtual v8::Handle<v8::Value> Call(v8::Handle<v8::Function> function,
+ v8::Handle<v8::Value> receiver,
+ int argc,
+ v8::Handle<v8::Value> argv[]) OVERRIDE;
+ virtual gin::ContextHolder* GetContextHolder() OVERRIDE;
+
protected:
// The v8 context the bindings are accessible to.
ScopedPersistent<v8::Context> v8_context_;

Powered by Google App Engine
This is Rietveld 408576698