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

Unified Diff: extensions/common/permissions/permissions_data.cc

Issue 443723003: extensions: Register 'app' and 'webstore' bindings only if they are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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/common/permissions/permissions_data.cc
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index 73afe4373fbc9bbca9f5bca1b34f53e8504cd6e9..6eb819993c4744382b2ef236c1bd29b82c1b7aa5 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -77,7 +77,7 @@ bool PermissionsData::IsRestrictedUrl(const GURL& document_url,
const GURL& top_frame_url,
const Extension* extension,
std::string* error) {
- if (CanExecuteScriptEverywhere(extension))
+ if (extension && CanExecuteScriptEverywhere(extension))
sadrul 2014/08/06 18:51:51 The null checks here are necessary since some test
not at google - send to devlin 2014/08/06 22:10:28 yeah this change is correct no matter what the con
return false;
// Check if the scheme is valid for extensions. If not, return.
@@ -103,9 +103,8 @@ bool PermissionsData::IsRestrictedUrl(const GURL& document_url,
return true;
}
- if (top_frame_url.SchemeIs(kExtensionScheme) &&
- top_frame_url.host() != extension->id() &&
- !allow_on_chrome_urls) {
+ if (extension && top_frame_url.SchemeIs(kExtensionScheme) &&
+ top_frame_url.host() != extension->id() && !allow_on_chrome_urls) {
if (error)
*error = manifest_errors::kCannotAccessExtensionUrl;
return true;

Powered by Google App Engine
This is Rietveld 408576698