Index: chrome/browser/nacl_host/nacl_process_host.cc |
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc |
index c854c1a0e815550308e6aa845e7fcdde6fb24b4b..1dfe6d2b2f885d59efe8d42c4b4c2ebeefe39c5e 100644 |
--- a/chrome/browser/nacl_host/nacl_process_host.cc |
+++ b/chrome/browser/nacl_host/nacl_process_host.cc |
@@ -740,7 +740,9 @@ bool NaClProcessHost::StartNaClExecution() { |
} |
bool NaClProcessHost::SendStart() { |
- if (!enable_ipc_proxy_) { |
+ // If render_view_id == 0, reply to the Renderer now, and skip creation |
+ // of the PPAPI IPC proxy channel in OnPpapiChannelCreated. |
+ if (!enable_ipc_proxy_ || !render_view_id_) { |
bbudge
2012/11/30 00:49:46
If you really don't need any IPC stuff, it would b
jvoung (off chromium)
2012/11/30 01:34:09
Ah ok. Done.
|
if (!ReplyToRenderer(IPC::ChannelHandle())) |
return false; |
} |
@@ -756,30 +758,36 @@ void NaClProcessHost::OnPpapiChannelCreated( |
// If the proxy channel is null, this must be the initial NaCl-Browser IPC |
// channel. |
if (!ipc_proxy_channel_.get()) { |
- ipc_proxy_channel_.reset( |
- new IPC::ChannelProxy(channel_handle, |
- IPC::Channel::MODE_CLIENT, |
- &ipc_plugin_listener_, |
- base::MessageLoopProxy::current())); |
- // Create the browser ppapi host and enable PPAPI message dispatching to the |
- // browser process. |
- content::BrowserPpapiHost::CreateExternalPluginProcess( |
- process_.get(), // sender |
- permissions_, |
- process_->GetData().handle, |
- ipc_proxy_channel_.get(), |
- chrome_render_message_filter_->GetHostResolver(), |
- chrome_render_message_filter_->render_process_id(), |
- render_view_id_); |
- // Send a message to create the NaCl-Renderer channel. The handle is just |
- // a place holder. |
- ipc_proxy_channel_->Send( |
- new PpapiMsg_CreateNaClChannel( |
- chrome_render_message_filter_->render_process_id(), |
- permissions_, |
- chrome_render_message_filter_->off_the_record(), |
- SerializedHandle(SerializedHandle::CHANNEL_HANDLE, |
- IPC::InvalidPlatformFileForTransit()))); |
+ // If render_view_id_ == 0, then we are launching a nexe that does not need |
+ // the PPAPI IPC proxy. In that case, we have already ReplyToRenderer'ed |
+ // in SendStart, so there is nothing to do. |
+ // Otherwise, we need the ipc_proxy_channel_. |
+ if (render_view_id_) { |
+ ipc_proxy_channel_.reset( |
+ new IPC::ChannelProxy(channel_handle, |
+ IPC::Channel::MODE_CLIENT, |
+ &ipc_plugin_listener_, |
+ base::MessageLoopProxy::current())); |
+ // Create the browser ppapi host and enable PPAPI message dispatching |
+ // to the browser process. |
+ content::BrowserPpapiHost::CreateExternalPluginProcess( |
+ process_.get(), // sender |
+ permissions_, |
+ process_->GetData().handle, |
+ ipc_proxy_channel_.get(), |
+ chrome_render_message_filter_->GetHostResolver(), |
+ chrome_render_message_filter_->render_process_id(), |
+ render_view_id_); |
+ // Send a message to create the NaCl-Renderer channel. The handle is just |
+ // a place holder. |
+ ipc_proxy_channel_->Send( |
+ new PpapiMsg_CreateNaClChannel( |
+ chrome_render_message_filter_->render_process_id(), |
+ permissions_, |
+ chrome_render_message_filter_->off_the_record(), |
+ SerializedHandle(SerializedHandle::CHANNEL_HANDLE, |
+ IPC::InvalidPlatformFileForTransit()))); |
+ } |
} else if (reply_msg_) { |
// Otherwise, this must be a renderer channel. |
ReplyToRenderer(channel_handle); |