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

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

Issue 10214007: Add an IPC channel between the NaCl loader process and the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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 | « chrome/browser/nacl_host/nacl_process_host.h ('k') | chrome/common/nacl_messages.h » ('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
===================================================================
--- chrome/browser/nacl_host/nacl_process_host.cc (revision 143480)
+++ chrome/browser/nacl_host/nacl_process_host.cc (working copy)
@@ -145,6 +145,9 @@
getenv("NACL_UNTRUSTED_EXCEPTION_HANDLING") != NULL) {
enable_exception_handling_ = true;
}
+
+ enable_ipc_proxy_ = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNaClIPCProxy);
}
NaClProcessHost::~NaClProcessHost() {
@@ -537,6 +540,8 @@
IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClProcessMsg_AttachDebugExceptionHandler,
OnAttachDebugExceptionHandler)
#endif
+ IPC_MESSAGE_HANDLER(NaClProcessHostMsg_PpapiChannelCreated,
+ OnPpapiChannelCreated)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -556,7 +561,8 @@
}
}
-bool NaClProcessHost::ReplyToRenderer() {
+bool NaClProcessHost::ReplyToRenderer(
+ const IPC::ChannelHandle& channel_handle) {
std::vector<nacl::FileDescriptor> handles_for_renderer;
for (size_t i = 0; i < internal_->sockets_for_renderer.size(); i++) {
#if defined(OS_WIN)
@@ -600,7 +606,7 @@
#endif
ChromeViewHostMsg_LaunchNaCl::WriteReplyParams(
- reply_msg_, handles_for_renderer);
+ reply_msg_, handles_for_renderer, channel_handle);
chrome_render_message_filter_->Send(reply_msg_);
chrome_render_message_filter_ = NULL;
reply_msg_ = NULL;
@@ -618,6 +624,7 @@
params.enable_exception_handling = enable_exception_handling_;
params.enable_debug_stub =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaClDebug);
+ params.enable_ipc_proxy = enable_ipc_proxy_;
base::PlatformFile irt_file = nacl_browser->IrtFile();
CHECK_NE(irt_file, base::kInvalidPlatformFileValue);
@@ -665,9 +672,19 @@
}
bool NaClProcessHost::SendStart() {
- return ReplyToRenderer() && StartNaClExecution();
+ if (!enable_ipc_proxy_) {
+ if (!ReplyToRenderer(IPC::ChannelHandle()))
+ return false;
+ }
+ return StartNaClExecution();
}
+void NaClProcessHost::OnPpapiChannelCreated(
+ const IPC::ChannelHandle& channel_handle) {
+ DCHECK(enable_ipc_proxy_);
+ ReplyToRenderer(channel_handle);
+}
+
bool NaClProcessHost::StartWithLaunchedProcess() {
#if defined(OS_LINUX)
if (wait_for_nacl_gdb_) {
« no previous file with comments | « chrome/browser/nacl_host/nacl_process_host.h ('k') | chrome/common/nacl_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698