Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 259a4e0d336313865bc4deefe8ba63f3ea4aac7f..7ef9f17337b2af4b7add329e8edc496e6e3256ea 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -683,9 +683,8 @@ net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
if (extension_service) { |
const extensions::Extension* installed_app = extension_service-> |
GetInstalledAppForRenderer(renderer_child_id); |
- if (installed_app != NULL && installed_app->is_storage_isolated()) { |
+ if (installed_app != NULL && installed_app->is_storage_isolated()) |
return GetRequestContextForIsolatedApp(installed_app->id()); |
- } |
} |
content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
@@ -703,7 +702,34 @@ net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
return GetRequestContext(); |
} |
-net::URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() { |
+net::URLRequestContextGetter* ProfileImpl::GetDefaultRequestContextForMedia() { |
+ // Return the default media context. |
+ return io_data_.GetMediaRequestContextGetter(); |
+} |
+ |
+net::URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia( |
+ int renderer_child_id) { |
+ ExtensionService* extension_service = |
+ extensions::ExtensionSystem::Get(this)->extension_service(); |
+ if (extension_service) { |
+ const extensions::Extension* installed_app = extension_service-> |
+ GetInstalledAppForRenderer(renderer_child_id); |
+ if (installed_app != NULL && installed_app->is_storage_isolated()) |
awong
2012/08/20 19:46:28
nit: I think this is more often written as:
if (
Charlie Reis
2012/08/20 20:21:01
Done, here and above.
|
+ return io_data_.GetIsolatedMediaRequestContextGetter(installed_app->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 io_data_.GetIsolatedMediaRequestContextGetter(id); |
+ } |
+ |
return io_data_.GetMediaRequestContextGetter(); |
} |