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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10600009: Support partitioning of storage contexts based on render_id. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased on jam@'s chromeos fixes. Created 8 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
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 91907f42b228770a60a4f4fbce2f0b44b2b16ed7..dfbc6e582568a074f254f77d647343fa6ec97eff 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -404,6 +404,25 @@ content::WebContentsView*
return NULL;
}
+std::string ChromeContentBrowserClient::GetStoragePartitionIdForChildProcess(
+ content::BrowserContext* browser_context,
+ int child_process_id) {
+ // In chrome, we use the extension ID as the partition ID. This works well
+ // because the extension ID fits the partition ID pattern and currently only
+ // apps can designate that storage should be isolated.
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ ExtensionService* extension_service =
+ ExtensionSystem::Get(profile)->extension_service();
+ if (extension_service) {
+ const extensions::Extension* installed_app = extension_service->
+ GetInstalledAppForRenderer(child_process_id);
+ if (installed_app != NULL && installed_app->is_storage_isolated()) {
jam 2012/07/11 02:09:25 nit: i thought the convention was just if (install
awong 2012/07/11 21:17:17 I wasn't aware of a convention, but happy to do it
+ return installed_app->id();
+ }
+ }
+ return std::string();
+}
+
content::WebContentsViewDelegate*
ChromeContentBrowserClient::GetWebContentsViewDelegate(
content::WebContents* web_contents) {

Powered by Google App Engine
This is Rietveld 408576698