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

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: Removed macro and InMemory. 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..2abf370c9c7ca6f1a34cc4fa5fe2a91410b20301 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -49,6 +49,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,28 +278,10 @@ 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();
+ CHECK(rph);
awong 2012/10/19 23:26:50 unnecessary CHECK(). The next line will crash due
nasko 2012/10/19 23:55:16 Done.
+ return rph->GetStoragePartition()->GetURLRequestContext();
}
net::URLRequestContextGetter*
@@ -316,8 +299,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*
@@ -327,8 +311,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