| Index: chrome/test/base/testing_profile.cc
|
| diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
|
| index 63eab1b5640d4241d6d69afacbdde8714495f23d..919b3418acdc62c69b41f58cd156833741a8e4df 100644
|
| --- a/chrome/test/base/testing_profile.cc
|
| +++ b/chrome/test/base/testing_profile.cc
|
| @@ -40,6 +40,7 @@
|
| #include "chrome/browser/prefs/testing_pref_store.h"
|
| #include "chrome/browser/prerender/prerender_manager.h"
|
| #include "chrome/browser/profiles/profile_dependency_manager.h"
|
| +#include "chrome/browser/profiles/storage_partition_descriptor.h"
|
| #include "chrome/browser/protector/protector_service_factory.h"
|
| #include "chrome/browser/search_engines/template_url_fetcher_factory.h"
|
| #include "chrome/browser/speech/chrome_speech_recognition_preferences.h"
|
| @@ -55,6 +56,7 @@
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/notification_service.h"
|
| +#include "content/public/browser/storage_partition.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/test/mock_resource_context.h"
|
| #include "content/public/test/test_utils.h"
|
| @@ -620,28 +622,18 @@ net::URLRequestContextGetter* TestingProfile::GetRequestContext() {
|
|
|
| net::URLRequestContextGetter* TestingProfile::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);
|
| + content::StoragePartition* storage_partition = rph->GetStoragePartition();
|
| +
|
| + // TODO(nasko): Remove this conditional, once browser tag creates a proper
|
| + // storage partition.
|
| + if (rph->IsGuest()) {
|
| + return GetRequestContextForStoragePartition(
|
| + storage_partition->GetPath(), true);
|
| }
|
|
|
| - return GetRequestContext();
|
| + return storage_partition->GetURLRequestContext();
|
| }
|
|
|
| void TestingProfile::CreateRequestContext() {
|
| @@ -671,7 +663,8 @@ TestingProfile::GetMediaRequestContextForRenderProcess(
|
|
|
| net::URLRequestContextGetter*
|
| TestingProfile::GetMediaRequestContextForStoragePartition(
|
| - const std::string& partition_id) {
|
| + const FilePath& partition_path,
|
| + bool in_memory) {
|
| return NULL;
|
| }
|
|
|
| @@ -687,7 +680,8 @@ net::SSLConfigService* TestingProfile::GetSSLConfigService() {
|
|
|
| net::URLRequestContextGetter*
|
| TestingProfile::GetRequestContextForStoragePartition(
|
| - const std::string& partition_id) {
|
| + const FilePath& partition_path,
|
| + bool in_memory) {
|
| // We don't test storage partitions here yet, so returning the same dummy
|
| // context is sufficient for now.
|
| return GetRequestContext();
|
|
|