Index: chrome/browser/renderer_host/browser_render_process_host.cc |
=================================================================== |
--- chrome/browser/renderer_host/browser_render_process_host.cc (revision 67520) |
+++ chrome/browser/renderer_host/browser_render_process_host.cc (working copy) |
@@ -297,18 +297,6 @@ |
// run the IPC channel on the shared IO thread. |
base::Thread* io_thread = g_browser_process->io_thread(); |
- // Construct the AudioRendererHost with the IO thread. |
- audio_renderer_host_ = new AudioRendererHost(); |
- |
- scoped_refptr<ResourceMessageFilter> resource_message_filter( |
- new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), |
- id(), |
- audio_renderer_host_.get(), |
- PluginService::GetInstance(), |
- g_browser_process->print_job_manager(), |
- profile(), |
- widget_helper_)); |
- |
CommandLine::StringType renderer_prefix; |
#if defined(OS_POSIX) |
// A command prefix is something prepended to the command line of the spawned |
@@ -330,7 +318,6 @@ |
ChildProcessInfo::GenerateRandomChannelID(this); |
channel_.reset( |
new IPC::SyncChannel(channel_id, IPC::Channel::MODE_SERVER, this, |
- resource_message_filter, |
io_thread->message_loop(), true, |
g_browser_process->shutdown_event())); |
// As a preventive mesure, we DCHECK if someone sends a synchronous message |
@@ -338,9 +325,7 @@ |
// be doing. |
channel_->set_sync_messages_with_no_timeout_allowed(false); |
- scoped_refptr<PepperFileMessageFilter> pepper_file_message_filter( |
- new PepperFileMessageFilter(id(), profile())); |
- channel_->AddFilter(pepper_file_message_filter); |
+ CreateMessageFilters(); |
if (run_renderer_in_process()) { |
// Crank up a thread and run the initialization there. With the way that |
@@ -392,6 +377,25 @@ |
return true; |
} |
+void BrowserRenderProcessHost::CreateMessageFilters() { |
+ // Construct the AudioRendererHost with the IO thread. |
+ audio_renderer_host_ = new AudioRendererHost(); |
+ |
+ scoped_refptr<ResourceMessageFilter> resource_message_filter( |
+ new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), |
+ id(), |
+ audio_renderer_host_.get(), |
+ PluginService::GetInstance(), |
+ g_browser_process->print_job_manager(), |
+ profile(), |
+ widget_helper_)); |
+ channel_->AddFilter(resource_message_filter); |
+ |
+ scoped_refptr<PepperFileMessageFilter> pepper_file_message_filter( |
+ new PepperFileMessageFilter(id(), profile())); |
+ channel_->AddFilter(pepper_file_message_filter); |
+} |
+ |
int BrowserRenderProcessHost::GetNextRoutingID() { |
return widget_helper_->GetNextRoutingID(); |
} |