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

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: 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 | « no previous file | chrome/browser/chromeos/offline/offline_load_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ba3f684bab013d4b2b0818ec14f8551550b27135..c6f2704385bafbeab3401617a3349fd46aa16983 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -687,8 +687,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;
@@ -785,8 +785,8 @@ void ChromeContentBrowserClient::GuestWebContentsAttached(
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) {
NOTREACHED();
return;
@@ -909,7 +909,7 @@ GURL ChromeContentBrowserClient::GetEffectiveURL(
return url;
const Extension* extension = extension_service->extensions()->
- GetHostedAppByURL(ExtensionURLInfo(url));
+ GetHostedAppByURL(url);
if (!extension)
return url;
@@ -950,8 +950,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;
@@ -1016,7 +1016,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 &&
@@ -1100,7 +1100,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))
@@ -1175,9 +1175,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;
@@ -1205,9 +1204,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;
@@ -1257,7 +1255,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 &&
@@ -1279,7 +1277,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);
}
bool ChromeContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) {
@@ -1939,8 +1937,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;
}
@@ -2265,8 +2263,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;
« no previous file with comments | « no previous file | chrome/browser/chromeos/offline/offline_load_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698