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

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: Fixing Android's BrowserContext. 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 7f76ba8aee97358b39cb223ef19898547985dad6..264cc1f006163fbfd691574f8b92b9af6e47d0d2 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -48,6 +48,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"
@@ -261,28 +262,9 @@ net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() {
net::URLRequestContextGetter*
OffTheRecordProfileImpl::GetRequestContextForRenderProcess(
int renderer_child_id) {
- 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());
- }
-
content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
renderer_child_id);
- if (rph && 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);
- }
-
- return GetRequestContext();
+ return rph->GetStoragePartition()->GetURLRequestContext();
}
net::URLRequestContextGetter*
@@ -300,8 +282,9 @@ net::URLRequestContextGetter*
net::URLRequestContextGetter*
OffTheRecordProfileImpl::GetMediaRequestContextForStoragePartition(
- const std::string& partition_id) {
- return GetRequestContextForStoragePartition(partition_id);
+ const FilePath& partition_path,
+ bool in_memory) {
+ return GetRequestContextForStoragePartition(partition_path, in_memory);
}
net::URLRequestContextGetter*
@@ -311,8 +294,9 @@ net::URLRequestContextGetter*
net::URLRequestContextGetter*
OffTheRecordProfileImpl::GetRequestContextForStoragePartition(
- const std::string& partition_id) {
- return io_data_.GetIsolatedAppRequestContextGetter(partition_id);
+ const FilePath& partition_path,
+ bool in_memory) {
+ return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory);
}
content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() {

Powered by Google App Engine
This is Rietveld 408576698