Chromium Code Reviews| Index: content/browser/renderer_host/render_process_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
| index cf27a0f299a3cc98667a3dec0d15530d1f3a4e46..b8231b918dd1ad75a82a869f0547e0598290ce78 100644 |
| --- a/content/browser/renderer_host/render_process_host_impl.cc |
| +++ b/content/browser/renderer_host/render_process_host_impl.cc |
| @@ -728,11 +728,6 @@ bool RenderProcessHostImpl::Init() { |
| const std::string channel_id = |
| IPC::Channel::GenerateVerifiedChannelID(std::string()); |
| channel_ = CreateChannelProxy(channel_id); |
| -#if USE_ATTACHMENT_BROKER |
| - IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( |
| - channel_.get(), content::BrowserThread::GetMessageLoopProxyForThread( |
| - content::BrowserThread::IO)); |
| -#endif |
| // Call the embedder first so that their IPC filters have priority. |
| GetContentClient()->browser()->RenderProcessWillLaunch(this); |
| @@ -828,9 +823,15 @@ std::unique_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( |
| } |
| #endif // OS_ANDROID |
| - return IPC::ChannelProxy::Create( |
|
Charlie Reis
2016/04/22 20:00:45
Your CL description makes it sounds like this call
erikchen
2016/04/25 20:10:57
I considered this. The reason I chose not to do th
|
| - IPC::ChannelMojo::CreateServerFactory(std::move(handle)), this, |
| - runner.get()); |
| + std::unique_ptr<IPC::ChannelProxy> channel( |
| + new IPC::ChannelProxy(this, runner.get())); |
| +#if USE_ATTACHMENT_BROKER |
| + IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( |
| + channel.get(), content::BrowserThread::GetMessageLoopProxyForThread( |
| + content::BrowserThread::IO)); |
| +#endif |
| + channel->Init(IPC::ChannelMojo::CreateServerFactory(std::move(handle)), true); |
| + return channel; |
| } |
| // Do NOT expand ifdef or run time condition checks here! See comment above. |
| @@ -841,8 +842,15 @@ std::unique_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( |
| } |
| #endif // OS_ANDROID |
| - return IPC::ChannelProxy::Create(channel_id, IPC::Channel::MODE_SERVER, this, |
| - runner.get()); |
| + std::unique_ptr<IPC::ChannelProxy> channel( |
| + new IPC::ChannelProxy(this, runner.get())); |
| +#if USE_ATTACHMENT_BROKER |
| + IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( |
| + channel.get(), content::BrowserThread::GetMessageLoopProxyForThread( |
| + content::BrowserThread::IO)); |
| +#endif |
| + channel->Init(channel_id, IPC::Channel::MODE_SERVER, true); |
| + return channel; |
| } |
| void RenderProcessHostImpl::CreateMessageFilters() { |