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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 16625012: Remove ExtensionURLInfo, make security decisions in render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 5710591df7440997a7b0a17d7dde8e06d0cd2dcc..fdb9367b7375bdaa0e5da9bc1c331e62b4529532 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -640,8 +640,8 @@ void ChromeContentBrowserClient::GetStoragePartitionConfigForSite(
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(profile)->extension_service();
if (extension_service) {
- extension = extension_service->extensions()->
- GetExtensionOrAppByURL(ExtensionURLInfo(site));
+ extension =
+ extension_service->extensions()->GetExtensionOrAppByURL(site);
if (extension &&
extensions::AppIsolationInfo::HasIsolatedStorage(extension)) {
is_isolated = true;
@@ -691,8 +691,8 @@ void ChromeContentBrowserClient::GuestWebContentsAttached(
if (!service)
return;
const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL();
- const Extension* extension = service->extensions()->
- GetExtensionOrAppByURL(ExtensionURLInfo(url));
+ const Extension* extension =
+ service->extensions()->GetExtensionOrAppByURL(url);
if (!extension)
return;
std::vector<ExtensionMsg_Loaded_Params> extensions;
@@ -802,7 +802,7 @@ GURL ChromeContentBrowserClient::GetEffectiveURL(
return url;
const Extension* extension = extension_service->extensions()->
- GetHostedAppByURL(ExtensionURLInfo(url));
+ GetHostedAppByURL(url);
if (!extension)
return url;
@@ -843,8 +843,8 @@ bool ChromeContentBrowserClient::ShouldUseProcessPerSite(
if (!extension_service)
return false;
- const Extension* extension = extension_service->extensions()->
- GetExtensionOrAppByURL(ExtensionURLInfo(effective_url));
+ const Extension* extension =
+ extension_service->extensions()->GetExtensionOrAppByURL(effective_url);
if (!extension)
return false;
@@ -909,7 +909,7 @@ bool ChromeContentBrowserClient::CanCommitURL(
if (!service)
return true;
const Extension* new_extension =
- service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url));
+ service->extensions()->GetExtensionOrAppByURL(url);
if (new_extension &&
new_extension->is_hosted_app() &&
new_extension->id() == extension_misc::kWebStoreAppId &&
@@ -993,7 +993,7 @@ bool ChromeContentBrowserClient::ShouldTryToUseExistingProcessHost(
// We have to have a valid extension with background page to proceed.
const Extension* extension =
- service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(url));
+ service->extensions()->GetExtensionOrAppByURL(url);
if (!extension)
return false;
if (!extensions::BackgroundInfo::HasBackgroundPage(extension))
@@ -1068,9 +1068,8 @@ void ChromeContentBrowserClient::SiteInstanceGotProcess(
if (!service)
return;
- const Extension* extension =
- service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(
- site_instance->GetSiteURL()));
+ const Extension* extension = service->extensions()->GetExtensionOrAppByURL(
+ site_instance->GetSiteURL());
if (!extension)
return;
@@ -1098,9 +1097,8 @@ void ChromeContentBrowserClient::SiteInstanceDeleting(
if (!service)
return;
- const Extension* extension =
- service->extensions()->GetExtensionOrAppByURL(
- ExtensionURLInfo(site_instance->GetSiteURL()));
+ const Extension* extension = service->extensions()->GetExtensionOrAppByURL(
+ site_instance->GetSiteURL());
if (!extension)
return;
@@ -1150,7 +1148,7 @@ bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation(
// We must swap if the URL is for an extension and we are not using an
// extension process.
const Extension* new_extension =
- service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo(new_url));
+ service->extensions()->GetExtensionOrAppByURL(new_url);
// Ignore all hosted apps except the Chrome Web Store, since they do not
// require their own BrowsingInstance (e.g., postMessage is ok).
if (new_extension &&
@@ -1172,7 +1170,7 @@ bool ChromeContentBrowserClient::ShouldSwapProcessesForRedirect(
ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
return extensions::CrossesExtensionProcessBoundary(
io_data->GetExtensionInfoMap()->extensions(),
- ExtensionURLInfo(current_url), ExtensionURLInfo(new_url), false);
+ current_url, new_url, false);
}
std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName(
@@ -1817,8 +1815,8 @@ bool ChromeContentBrowserClient::CanCreateWindow(
// because the permission check above would have caused an early return
// already. We must use the full URL to find hosted apps, though, and not
// just the origin.
- const Extension* extension = map->extensions().GetExtensionOrAppByURL(
- ExtensionURLInfo(opener_url));
+ const Extension* extension =
+ map->extensions().GetExtensionOrAppByURL(opener_url);
if (extension && !extensions::BackgroundInfo::AllowJSAccess(extension))
*no_javascript_access = true;
}
@@ -2142,8 +2140,8 @@ bool ChromeContentBrowserClient::SupportsBrowserPlugin(
if (!service)
return false;
- const Extension* extension = service->extensions()->
- GetExtensionOrAppByURL(ExtensionURLInfo(site_url));
+ const Extension* extension =
+ service->extensions()->GetExtensionOrAppByURL(site_url);
if (!extension)
return false;

Powered by Google App Engine
This is Rietveld 408576698