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

Unified Diff: chrome/common/extensions/extension_set.h

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback Created 7 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
« no previous file with comments | « chrome/common/extensions/extension_process_policy.cc ('k') | chrome/common/extensions/extension_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_set.h
diff --git a/chrome/common/extensions/extension_set.h b/chrome/common/extensions/extension_set.h
index 34a39f38605e4b4c66085e07b9fda3cd9b41a273..e07a629dc463e2cbc5e0d3fa3da2bd1d2f9f2a78 100644
--- a/chrome/common/extensions/extension_set.h
+++ b/chrome/common/extensions/extension_set.h
@@ -12,31 +12,8 @@
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "chrome/common/extensions/extension.h"
-#include "third_party/WebKit/public/web/WebSecurityOrigin.h"
#include "url/gurl.h"
-class ExtensionURLInfo {
- public:
- // The extension system uses both a document's origin and its URL to
- // grant permissions. Ideally, we would use only the origin, but because
- // the web extent of a hosted app can be less than an entire origin, we
- // take the URL into account as well
- ExtensionURLInfo(WebKit::WebSecurityOrigin origin, const GURL& url);
-
- // WARNING! Using this constructor can miss important security checks if
- // you're trying to find a running extension. For example, if the
- // URL in question is being rendered inside an iframe sandbox, then
- // we might incorrectly grant it access to powerful extension APIs.
- explicit ExtensionURLInfo(const GURL& url);
-
- const WebKit::WebSecurityOrigin& origin() const { return origin_; }
- const GURL& url() const { return url_; }
-
- private:
- WebKit::WebSecurityOrigin origin_;
- GURL url_;
-};
-
// The one true extension container. Extensions are identified by their id.
// Only one extension can be in the set with a given ID.
class ExtensionSet {
@@ -102,19 +79,17 @@ class ExtensionSet {
// Returns the extension ID, or empty if none. This includes web URLs that
// are part of an extension's web extent.
- std::string GetExtensionOrAppIDByURL(const ExtensionURLInfo& info) const;
+ std::string GetExtensionOrAppIDByURL(const GURL& url) const;
// Returns the Extension, or NULL if none. This includes web URLs that are
// part of an extension's web extent.
// NOTE: This can return NULL if called before UpdateExtensions receives
// bulk extension data (e.g. if called from
// EventBindings::HandleContextCreated)
- const extensions::Extension* GetExtensionOrAppByURL(
- const ExtensionURLInfo& info) const;
+ const extensions::Extension* GetExtensionOrAppByURL(const GURL& url) const;
// Returns the hosted app whose web extent contains the URL.
- const extensions::Extension* GetHostedAppByURL(
- const ExtensionURLInfo& info) const;
+ const extensions::Extension* GetHostedAppByURL(const GURL& url) const;
// Returns a hosted app that contains any URL that overlaps with the given
// extent, if one exists.
@@ -134,11 +109,7 @@ class ExtensionSet {
// Returns true if |info| should get extension api bindings and be permitted
// to make api calls. Note that this is independent of what extension
// permissions the given extension has been granted.
- bool ExtensionBindingsAllowed(const ExtensionURLInfo& info) const;
-
- // Returns true if |info| is an extension page that is to be served in a
- // unique sandboxed origin.
- bool IsSandboxedPage(const ExtensionURLInfo& info) const;
+ bool ExtensionBindingsAllowed(const GURL& url) const;
private:
FRIEND_TEST_ALL_PREFIXES(ExtensionSetTest, ExtensionSet);
« no previous file with comments | « chrome/common/extensions/extension_process_policy.cc ('k') | chrome/common/extensions/extension_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698