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

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 6201005: Initial support for partitioning cookies for isolated apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor and address comments. Created 9 years, 10 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
Index: chrome/browser/renderer_host/browser_render_process_host.cc
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 30916b4f10d6bf7d6fbf599f19e5dff597693749..c2bf6e3aaefa39eab8f5f981e550c139a5e01a39 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -238,8 +238,10 @@ namespace {
class RendererURLRequestContextOverride
: public ResourceMessageFilter::URLRequestContextOverride {
public:
- explicit RendererURLRequestContextOverride(Profile* profile)
- : request_context_(profile->GetRequestContext()),
+ RendererURLRequestContextOverride(Profile* profile,
+ const Extension* installed_app)
+ : request_context_(profile->GetRequestContextForPossibleApp(
+ installed_app)),
media_request_context_(profile->GetRequestContextForMedia()) {
}
@@ -335,7 +337,8 @@ BrowserRenderProcessHost::~BrowserRenderProcessHost() {
}
bool BrowserRenderProcessHost::Init(
- bool is_accessibility_enabled, bool is_extensions_process) {
+ bool is_accessibility_enabled, bool is_extensions_process,
+ const Extension* installed_app) {
// calling Init() more than once does nothing, this makes it more convenient
// for the view host which may not be sure in some cases
if (channel_.get())
@@ -347,6 +350,9 @@ bool BrowserRenderProcessHost::Init(
// content, e.g. if an extension calls window.open.
extension_process_ = extension_process_ || is_extensions_process;
+ // Keep track of the installed app for this process, if any.
+ installed_app_ = installed_app;
+
// run the IPC channel on the shared IO thread.
base::Thread* io_thread = g_browser_process->io_thread();
@@ -435,11 +441,12 @@ void BrowserRenderProcessHost::CreateMessageFilters() {
new RenderMessageFilter(id(),
PluginService::GetInstance(),
profile(),
- widget_helper_));
+ widget_helper_,
+ installed_app_));
channel_->AddFilter(render_message_filter);
scoped_refptr<RendererURLRequestContextOverride> url_request_context_override(
- new RendererURLRequestContextOverride(profile()));
+ new RendererURLRequestContextOverride(profile(), installed_app_));
ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter(
id(), ChildProcessInfo::RENDER_PROCESS,

Powered by Google App Engine
This is Rietveld 408576698