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 205a3cf326364dcc516140b0f3782df294ec68cb..1605e96ed2e8e514ee82e8035257fdb721896ec9 100644 |
--- a/chrome/browser/renderer_host/browser_render_process_host.cc |
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc |
@@ -240,8 +240,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()) { |
} |
@@ -336,8 +338,9 @@ BrowserRenderProcessHost::~BrowserRenderProcessHost() { |
ClearTransportDIBCache(); |
} |
-bool BrowserRenderProcessHost::Init( |
- bool is_accessibility_enabled, bool is_extensions_process) { |
+bool BrowserRenderProcessHost::Init(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()) |
@@ -349,6 +352,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(); |
@@ -437,11 +443,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, |