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

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: rebase Created 8 years, 9 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 e72c26929ce64a97fc65c6602e19520da126e862..b1dfb4054f7d0e7011bcb2c53c76c106eb335a87 100644
--- a/chrome/renderer/extensions/extension_dispatcher.h
+++ b/chrome/renderer/extensions/extension_dispatcher.h
@@ -15,8 +15,10 @@
#include "content/public/renderer/render_process_observer.h"
#include "chrome/common/extensions/extension_set.h"
#include "chrome/renderer/extensions/chrome_v8_context_set.h"
+#include "chrome/renderer/resource_bundle_source_map.h"
#include "v8/include/v8.h"
+class ModuleSystem;
class GURL;
class URLPattern;
class UserScriptSlave;
@@ -55,12 +57,18 @@ class ExtensionDispatcher : public content::RenderProcessObserver {
bool IsApplicationActive(const std::string& extension_id) const;
bool IsExtensionActive(const std::string& extension_id) const;
+ // Whether or not we should set up custom bindings for this api.
+ bool AllowCustomAPI(WebKit::WebFrame* frame,
+ const std::string& custom_binding_api_name,
+ int world_id);
+
// See WebKit::WebPermissionClient::allowScriptExtension
// TODO(koz): Remove once WebKit no longer calls this.
bool AllowScriptExtension(WebKit::WebFrame* frame,
const std::string& v8_extension_name,
int extension_group);
+ // TODO(koz): Remove once WebKit no longer calls this.
bool AllowScriptExtension(WebKit::WebFrame* frame,
const std::string& v8_extension_name,
int extension_group,
@@ -137,6 +145,12 @@ class ExtensionDispatcher : public content::RenderProcessObserver {
const Extension* extension,
const URLPatternSet& origins);
+ void RegisterNativeHandlers(ModuleSystem* module_system,
+ ChromeV8Context* context);
+
+ // Inserts static source code into |source_map_|.
+ void PopulateSourceMap();
+
// 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);
@@ -182,6 +196,8 @@ class ExtensionDispatcher : public content::RenderProcessObserver {
bool webrequest_adblock_plus_;
bool webrequest_other_;
+ ResourceBundleSourceMap source_map_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher);
};
« no previous file with comments | « chrome/renderer/extensions/extension_custom_bindings.cc ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698