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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 11308024: Fixing guest processes to use the proper storage partition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some substring match bugs Created 8 years, 2 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 c755dc03e2f75c23cfe5d7160613152a8f52ea71..523e669e54dd2efecb1ab4292425c8538b560fcb 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -491,6 +491,9 @@ std::string ChromeContentBrowserClient::GetStoragePartitionIdForChildProcess(
std::string ChromeContentBrowserClient::GetStoragePartitionIdForSite(
content::BrowserContext* browser_context,
const GURL& site) {
+ if (site.SchemeIs(chrome::kGuestScheme))
+ return "guest-" + site.host();
+
const Extension* extension = NULL;
Profile* profile = Profile::FromBrowserContext(browser_context);
ExtensionService* extension_service =
@@ -1604,10 +1607,14 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
chrome::ViewType view_type = chrome::GetViewType(web_contents);
ExtensionService* service = profile->GetExtensionService();
if (service) {
- const Extension* extension = service->extensions()->GetByID(
- rvh->GetSiteInstance()->GetSiteURL().host());
- extension_webkit_preferences::SetPreferences(
- extension, view_type, web_prefs);
+ const GURL& url = rvh->GetSiteInstance()->GetSiteURL();
+ const Extension* extension = service->extensions()->GetByID(url.host());
+ // Guests are not extensions, so they should not be given any extra
+ // privileges.
Charlie Reis 2012/10/27 01:11:43 nit: This comment is confusing unless you know mor
awong 2012/10/27 01:23:54 Done.
+ if (url.SchemeIs(chrome::kExtensionScheme)) {
+ extension_webkit_preferences::SetPreferences(
+ extension, view_type, web_prefs);
+ }
}
if (content::IsForceCompositingModeEnabled())
« no previous file with comments | « no previous file | chrome/browser/extensions/web_view_browsertest.cc » ('j') | chrome/browser/extensions/web_view_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698