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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 10836305: Ensure that isolated apps use the right cookies for media requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict. Created 8 years, 4 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_impl_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index ff2725ccb93433a22b590c5ccaf9ff39ea23c04f..1f2b99da012d16c369bcc656e439ac62b1c2c3c0 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -684,9 +684,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 && installed_app->is_storage_isolated())
return GetRequestContextForIsolatedApp(installed_app->id());
- }
}
content::RenderProcessHost* rph = content::RenderProcessHost::FromID(
@@ -704,7 +703,35 @@ net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess(
return GetRequestContext();
}
-net::URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() {
+net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContext() {
+ // Return the default media context.
+ return io_data_.GetMediaRequestContextGetter();
+}
+
+net::URLRequestContextGetter*
+ProfileImpl::GetMediaRequestContextForRenderProcess(
+ 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 && installed_app->is_storage_isolated())
+ 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();
}
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_impl_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698