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

Unified Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing bool param to pass by reference. 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/profiles/off_the_record_profile_impl.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index 75d42a62520d1dfa419c5cc24a9833f88e5261a2..a7278aff3d61791226c28ede9f43aea32fd188a7 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -34,6 +34,7 @@
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
+#include "chrome/browser/storage_partition_details.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
@@ -49,6 +50,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "net/base/transport_security_state.h"
#include "net/http/http_server_properties.h"
@@ -277,25 +279,29 @@ net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() {
net::URLRequestContextGetter*
OffTheRecordProfileImpl::GetRequestContextForRenderProcess(
int renderer_child_id) {
+ content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
+ renderer_child_id);
+ CHECK(rph);
+ content::StoragePartition* storage_partition = rph->GetStoragePartition();
+
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(this)->extension_service();
if (extension_service) {
const extensions::Extension* extension =
extension_service->GetIsolatedAppForRenderer(renderer_child_id);
if (extension)
- return GetRequestContextForStoragePartition(extension->id());
+ return GetRequestContextForStoragePartition(
+ storage_partition->GetPath(),
+ storage_partition->IsInMemoryOnly());
}
- content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
- renderer_child_id);
- if (rph && rph->IsGuest()) {
+ if (rph->IsGuest()) {
// For guest processes (used by the browser tag), we need to isolate the
// storage.
- // TODO(nasko): Until we have proper storage partitions, create a
- // non-persistent context using the RPH's id.
- std::string id("guest-");
- id.append(base::IntToString(renderer_child_id));
- return GetRequestContextForStoragePartition(id);
+ // TODO(nasko): Pass the proper value for in_memory when the browser tag
+ // is wired properly with storage partition
+ return GetRequestContextForStoragePartition(
+ storage_partition->GetPath(), true);
}
return GetRequestContext();
@@ -316,8 +322,9 @@ net::URLRequestContextGetter*
net::URLRequestContextGetter*
OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition(
- const std::string& partition_id) {
- return GetRequestContextForStoragePartition(partition_id);
+ const FilePath& partition_path,
+ const bool& in_memory) {
+ return GetRequestContextForStoragePartition(partition_path, in_memory);
}
net::URLRequestContextGetter*
@@ -327,8 +334,10 @@ net::URLRequestContextGetter*
net::URLRequestContextGetter*
OffTheRecordProfileImpl::GetRequestContextForStoragePartition(
- const std::string& partition_id) {
- return io_data_.GetIsolatedAppRequestContextGetter(partition_id);
+ const FilePath& partition_path,
+ const bool& in_memory) {
+ StoragePartitionDetails details(partition_path, in_memory);
+ return io_data_.GetIsolatedAppRequestContextGetter(details);
}
content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() {

Powered by Google App Engine
This is Rietveld 408576698