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

Side by Side 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 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 return main_parts; 397 return main_parts;
398 } 398 }
399 399
400 content::WebContentsView* 400 content::WebContentsView*
401 ChromeContentBrowserClient::OverrideCreateWebContentsView( 401 ChromeContentBrowserClient::OverrideCreateWebContentsView(
402 WebContents* web_contents, 402 WebContents* web_contents,
403 content::RenderViewHostDelegateView** render_view_host_delegate_view) { 403 content::RenderViewHostDelegateView** render_view_host_delegate_view) {
404 return NULL; 404 return NULL;
405 } 405 }
406 406
407 std::string ChromeContentBrowserClient::GetStoragePartitionIdForChildProcess(
408 content::BrowserContext* browser_context,
409 int child_process_id) {
410 // In chrome, we use the extension ID as the partition ID. This works well
411 // because the extension ID fits the partition ID pattern and currently only
412 // apps can designate that storage should be isolated.
413 Profile* profile = Profile::FromBrowserContext(browser_context);
414 ExtensionService* extension_service =
415 extensions::ExtensionSystem::Get(profile)->extension_service();
416 if (extension_service) {
417 const extensions::Extension* installed_app = extension_service->
418 GetInstalledAppForRenderer(child_process_id);
419 if (installed_app && installed_app->is_storage_isolated()) {
420 return installed_app->id();
421 }
422 }
423 return std::string();
424 }
425
407 content::WebContentsViewDelegate* 426 content::WebContentsViewDelegate*
408 ChromeContentBrowserClient::GetWebContentsViewDelegate( 427 ChromeContentBrowserClient::GetWebContentsViewDelegate(
409 content::WebContents* web_contents) { 428 content::WebContents* web_contents) {
410 return chrome::CreateWebContentsViewDelegate(web_contents); 429 return chrome::CreateWebContentsViewDelegate(web_contents);
411 } 430 }
412 431
413 void ChromeContentBrowserClient::RenderViewHostCreated( 432 void ChromeContentBrowserClient::RenderViewHostCreated(
414 RenderViewHost* render_view_host) { 433 RenderViewHost* render_view_host) {
415 434
416 SiteInstance* site_instance = render_view_host->GetSiteInstance(); 435 SiteInstance* site_instance = render_view_host->GetSiteInstance();
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 io_thread_application_locale_ = locale; 1666 io_thread_application_locale_ = locale;
1648 } 1667 }
1649 1668
1650 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( 1669 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread(
1651 const std::string& locale) { 1670 const std::string& locale) {
1652 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1671 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1653 io_thread_application_locale_ = locale; 1672 io_thread_application_locale_ = locale;
1654 } 1673 }
1655 1674
1656 } // namespace chrome 1675 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698