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

Unified Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 11428063: Add a flag to LaunchSelLdr to skip grabbing a routing_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: skip PPAPI in nacl_process_host Created 8 years, 1 month 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
« no previous file with comments | « no previous file | chrome/renderer/pepper/ppb_nacl_private_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/renderer/pepper/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698