Chromium Code Reviews| 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() { |