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

Unified Diff: chrome/renderer/extensions/extension_dispatcher.h

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: chrome/renderer/extensions/extension_dispatcher.h
diff --git a/chrome/renderer/extensions/extension_dispatcher.h b/chrome/renderer/extensions/extension_dispatcher.h
index 97964302b41e99726f42521fc17514cd447d3aa7..f3f5ce2c450ddbe9b1f9665e3727e5a6e84229f4 100644
--- a/chrome/renderer/extensions/extension_dispatcher.h
+++ b/chrome/renderer/extensions/extension_dispatcher.h
@@ -17,6 +17,7 @@
#include "chrome/renderer/extensions/chrome_v8_context_set.h"
#include "v8/include/v8.h"
+class ChromeV8Extension;
class GURL;
class URLPattern;
class UserScriptSlave;
@@ -66,8 +67,14 @@ class ExtensionDispatcher : public content::RenderProcessObserver {
int extension_group,
int world_id);
+ bool AllowAPI(WebKit::WebFrame* frame,
+ const std::string& v8_extension_name,
+ int extension_group,
+ int world_id);
+
void DidCreateScriptContext(WebKit::WebFrame* frame,
v8::Handle<v8::Context> context,
+ int extension_group,
int world_id);
void WillReleaseScriptContext(WebKit::WebFrame* frame,
v8::Handle<v8::Context> context,
@@ -137,10 +144,19 @@ class ExtensionDispatcher : public content::RenderProcessObserver {
const Extension* extension,
const URLPatternSet& origins);
+ // Set up the extension API bindings in |context|.
+ void SetupAPIBindings(ChromeV8Context* context,
+ WebKit::WebFrame* frame,
+ int extension_group,
+ int world_id);
+
// Finds the extension ID for the current context. This is determined from
// |world_id| if it's non-zero, or the URL in |frame| if it is.
std::string GetExtensionID(WebKit::WebFrame* frame, int world_id);
+ void RegisterExtensions(ChromeV8Context* context);
+ v8::Handle<v8::Object> BuildBrowserObject(ChromeV8Context* context);
+
// True if this renderer is running extensions.
bool is_extension_process_;

Powered by Google App Engine
This is Rietveld 408576698