summaryrefslogtreecommitdiffstats
path: root/chrome/test/base
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-18 03:04:09 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-18 03:04:09 +0000
commit10eb2816fd7d28974114910aa5bfc105366a187f (patch)
tree7584d8faaa940e6ce8bb08320004ff402160b60e /chrome/test/base
parentf37a6bc327a34487e61beab79c3ec06390a42320 (diff)
downloadchromium_src-10eb2816fd7d28974114910aa5bfc105366a187f.zip
chromium_src-10eb2816fd7d28974114910aa5bfc105366a187f.tar.gz
chromium_src-10eb2816fd7d28974114910aa5bfc105366a187f.tar.bz2
continuing from http://http://codereview.chromium.org/10823241
This intentionally doesn't change the ChromeOS behavior at all. They all still use the default FileSystemContext. This code also exposes the normal and media URLRequestGetters via the StoragePartition, and cleans up a bit of code that was accessing the URLRequestGetter in odd ways. Also, it makes Workers correctly use the Media Cache for Media fetches. TBR=benjhyden,sky,davemoore,piman,mkwst,kalman BUG=85121 Review URL: https://chromiumcodereview.appspot.com/10909182 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base')
-rw-r--r--chrome/test/base/testing_profile.cc17
-rw-r--r--chrome/test/base/testing_profile.h7
2 files changed, 17 insertions, 7 deletions
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index e715ade..9f34ca3 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -616,7 +616,7 @@ net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess(
const extensions::Extension* installed_app = extension_service->
GetInstalledAppForRenderer(renderer_child_id);
if (installed_app != NULL && installed_app->is_storage_isolated())
- return GetRequestContextForIsolatedApp(installed_app->id());
+ return GetRequestContextForStoragePartition(installed_app->id());
}
content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
@@ -628,7 +628,7 @@ net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess(
// non-persistent context using the RPH's id.
std::string id("guest-");
id.append(base::IntToString(renderer_child_id));
- return GetRequestContextForIsolatedApp(id);
+ return GetRequestContextForStoragePartition(id);
}
return GetRequestContext();
@@ -659,6 +659,12 @@ TestingProfile::GetMediaRequestContextForRenderProcess(
return NULL;
}
+net::URLRequestContextGetter*
+TestingProfile::GetMediaRequestContextForStoragePartition(
+ const std::string& partition_id) {
+ return NULL;
+}
+
net::URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() {
if (!extensions_request_context_)
extensions_request_context_ = new TestExtensionURLRequestContextGetter();
@@ -669,9 +675,10 @@ net::SSLConfigService* TestingProfile::GetSSLConfigService() {
return NULL;
}
-net::URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp(
- const std::string& app_id) {
- // We don't test isolated app storage here yet, so returning the same dummy
+net::URLRequestContextGetter*
+TestingProfile::GetRequestContextForStoragePartition(
+ const std::string& partition_id) {
+ // We don't test storage partitions here yet, so returning the same dummy
// context is sufficient for now.
return GetRequestContext();
}
diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h
index 0476899..1c48188 100644
--- a/chrome/test/base/testing_profile.h
+++ b/chrome/test/base/testing_profile.h
@@ -245,8 +245,11 @@ class TestingProfile : public Profile {
int renderer_child_id) OVERRIDE;
virtual net::URLRequestContextGetter*
GetRequestContextForExtensions() OVERRIDE;
- virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp(
- const std::string& app_id) OVERRIDE;
+ virtual net::URLRequestContextGetter*
+ GetMediaRequestContextForStoragePartition(
+ const std::string& partition_id) OVERRIDE;
+ virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition(
+ const std::string& partition_id) OVERRIDE;
virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE;
virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE;
virtual std::wstring GetName();