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

Unified Diff: extensions/renderer/dispatcher.h

Issue 1013823003: Revert of Move Extension ScriptContext creation into ScriptContextSet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « chrome/renderer/extensions/webstore_bindings.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.h
diff --git a/extensions/renderer/dispatcher.h b/extensions/renderer/dispatcher.h
index c71cb64757bd3b6c12b13358ac0cd834f195b665..c5ac3651f0b335faa177414e2f9fa727a7778bc0 100644
--- a/extensions/renderer/dispatcher.h
+++ b/extensions/renderer/dispatcher.h
@@ -11,12 +11,10 @@
#include <utility>
#include <vector>
-#include "base/memory/scoped_ptr.h"
#include "base/scoped_observer.h"
#include "base/timer/timer.h"
#include "content/public/renderer/render_process_observer.h"
#include "extensions/common/event_filter.h"
-#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/features/feature.h"
@@ -55,6 +53,7 @@
namespace extensions {
class ContentWatcher;
class DispatcherDelegate;
+class Extension;
class FilteredEventRouter;
class ManifestPermissionSet;
class RequestSender;
@@ -77,7 +76,7 @@
const ExtensionSet* extensions() const { return &extensions_; }
const ScriptContextSet& script_context_set() const {
- return *script_context_set_;
+ return script_context_set_;
}
V8SchemaRegistry* v8_schema_registry() { return v8_schema_registry_.get(); }
@@ -89,6 +88,14 @@
void OnRenderViewCreated(content::RenderView* render_view);
bool IsExtensionActive(const std::string& extension_id) const;
+
+ // Finds the extension for the JavaScript context associated with the
+ // specified |frame| and isolated world. If |world_id| is zero, finds the
+ // extension ID associated with the main world's JavaScript context. If the
+ // JavaScript context isn't from an extension, returns empty string.
+ const Extension* GetExtensionFromFrameAndWorld(const blink::WebFrame* frame,
+ int world_id,
+ bool use_effective_url);
void DidCreateScriptContext(blink::WebLocalFrame* frame,
const v8::Handle<v8::Context>& context,
@@ -235,6 +242,15 @@
// Returns whether the current renderer hosts a platform app.
bool IsWithinPlatformApp();
+ bool IsSandboxedPage(const GURL& url) const;
+
+ // Returns the Feature::Context type of context for a JavaScript context.
+ Feature::Context ClassifyJavaScriptContext(
+ const Extension* extension,
+ int extension_group,
+ const GURL& url,
+ const blink::WebSecurityOrigin& origin);
+
// Gets |field| from |object| or creates it as an empty object if it doesn't
// exist.
v8::Handle<v8::Object> GetOrCreateObject(const v8::Handle<v8::Object>& object,
@@ -268,7 +284,7 @@
// All the bindings contexts that are currently loaded for this renderer.
// There is zero or one for each v8 context.
- scoped_ptr<ScriptContextSet> script_context_set_;
+ ScriptContextSet script_context_set_;
scoped_ptr<ContentWatcher> content_watcher_;
@@ -284,7 +300,7 @@
std::set<std::string> function_names_;
// The extensions and apps that are active in this process.
- ExtensionIdSet active_extension_ids_;
+ std::set<std::string> active_extension_ids_;
ResourceBundleSourceMap source_map_;
« no previous file with comments | « chrome/renderer/extensions/webstore_bindings.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698