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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 10909182: Make FileSystemContext respect StoragePartitions. filesystem:// urls will be properly isolated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove useless headers. Created 8 years, 3 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 | Annotate | Revision Log
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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 673 }
674 674
675 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( 675 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess(
676 int renderer_child_id) { 676 int renderer_child_id) {
677 ExtensionService* extension_service = 677 ExtensionService* extension_service =
678 extensions::ExtensionSystem::Get(this)->extension_service(); 678 extensions::ExtensionSystem::Get(this)->extension_service();
679 if (extension_service) { 679 if (extension_service) {
680 const extensions::Extension* installed_app = extension_service-> 680 const extensions::Extension* installed_app = extension_service->
681 GetInstalledAppForRenderer(renderer_child_id); 681 GetInstalledAppForRenderer(renderer_child_id);
682 if (installed_app && installed_app->is_storage_isolated()) 682 if (installed_app && installed_app->is_storage_isolated())
683 return GetRequestContextForIsolatedApp(installed_app->id()); 683 return GetRequestContextForStoragePartition(installed_app->id());
684 } 684 }
685 685
686 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( 686 content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
687 renderer_child_id); 687 renderer_child_id);
688 if (rph && rph->IsGuest()) { 688 if (rph && rph->IsGuest()) {
689 // For guest processes (used by the browser tag), we need to isolate the 689 // For guest processes (used by the browser tag), we need to isolate the
690 // storage. 690 // storage.
691 // TODO(nasko): Until we have proper storage partitions, create a 691 // TODO(nasko): Until we have proper storage partitions, create a
692 // non-persistent context using the RPH's id. 692 // non-persistent context using the RPH's id.
693 std::string id("guest-"); 693 std::string id("guest-");
694 id.append(base::IntToString(renderer_child_id)); 694 id.append(base::IntToString(renderer_child_id));
695 return GetRequestContextForIsolatedApp(id); 695 return GetRequestContextForStoragePartition(id);
696 } 696 }
697 697
698 return GetRequestContext(); 698 return GetRequestContext();
699 } 699 }
700 700
701 net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContext() { 701 net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContext() {
702 // Return the default media context. 702 // Return the default media context.
703 return io_data_.GetMediaRequestContextGetter(); 703 return io_data_.GetMediaRequestContextGetter();
704 } 704 }
705 705
(...skipping 17 matching lines...) Expand all
723 // TODO(nasko): Until we have proper storage partitions, create a 723 // TODO(nasko): Until we have proper storage partitions, create a
724 // non-persistent context using the RPH's id. 724 // non-persistent context using the RPH's id.
725 std::string id("guest-"); 725 std::string id("guest-");
726 id.append(base::IntToString(renderer_child_id)); 726 id.append(base::IntToString(renderer_child_id));
727 return io_data_.GetIsolatedMediaRequestContextGetter(id); 727 return io_data_.GetIsolatedMediaRequestContextGetter(id);
728 } 728 }
729 729
730 return io_data_.GetMediaRequestContextGetter(); 730 return io_data_.GetMediaRequestContextGetter();
731 } 731 }
732 732
733 net::URLRequestContextGetter*
734 ProfileImpl::GetMediaRequestContextForStoragePartition(
735 const std::string& partition_id) {
736 return io_data_.GetIsolatedMediaRequestContextGetter(partition_id);
737 }
738
733 content::ResourceContext* ProfileImpl::GetResourceContext() { 739 content::ResourceContext* ProfileImpl::GetResourceContext() {
734 return io_data_.GetResourceContext(); 740 return io_data_.GetResourceContext();
735 } 741 }
736 742
737 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { 743 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() {
738 return io_data_.GetExtensionsRequestContextGetter(); 744 return io_data_.GetExtensionsRequestContextGetter();
739 } 745 }
740 746
741 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( 747 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForStoragePartition(
742 const std::string& app_id) { 748 const std::string& partition_id) {
743 return io_data_.GetIsolatedAppRequestContextGetter(app_id); 749 return io_data_.GetIsolatedAppRequestContextGetter(partition_id);
744 } 750 }
745 751
746 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { 752 net::SSLConfigService* ProfileImpl::GetSSLConfigService() {
747 return ssl_config_service_manager_->Get(); 753 return ssl_config_service_manager_->Get();
748 } 754 }
749 755
750 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { 756 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() {
751 if (!host_content_settings_map_.get()) { 757 if (!host_content_settings_map_.get()) {
752 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); 758 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false);
753 } 759 }
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 if (!path.empty()) 1096 if (!path.empty())
1091 *cache_path = path; 1097 *cache_path = path;
1092 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1098 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1093 prefs_->GetInteger(prefs::kDiskCacheSize); 1099 prefs_->GetInteger(prefs::kDiskCacheSize);
1094 } 1100 }
1095 1101
1096 base::Callback<ChromeURLDataManagerBackend*(void)> 1102 base::Callback<ChromeURLDataManagerBackend*(void)>
1097 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { 1103 ProfileImpl::GetChromeURLDataManagerBackendGetter() const {
1098 return io_data_.GetChromeURLDataManagerBackendGetter(); 1104 return io_data_.GetChromeURLDataManagerBackendGetter();
1099 } 1105 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698