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

Unified Diff: chrome/nacl/nacl_listener.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, 7 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
Index: chrome/nacl/nacl_listener.cc
===================================================================
--- chrome/nacl/nacl_listener.cc (revision 136022)
+++ chrome/nacl/nacl_listener.cc (working copy)
@@ -11,12 +11,14 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/nacl_messages.h"
#include "chrome/nacl/nacl_validation_db.h"
#include "chrome/nacl/nacl_validation_query.h"
+#include "ipc/ipc_channel_handle.h"
+#include "ipc/ipc_switches.h"
#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_sync_message_filter.h"
-#include "ipc/ipc_switches.h"
#include "native_client/src/trusted/service_runtime/sel_main_chrome.h"
#if defined(OS_LINUX)
@@ -142,8 +144,10 @@
NaClListener::NaClListener() : shutdown_event_(true, false),
io_thread_("NaCl_IOThread"),
main_loop_(NULL),
+ nacl_ppapi_channel_(NULL),
debug_enabled_(false) {
io_thread_.StartWithOptions(base::Thread::Options(MessageLoop::TYPE_IO, 0));
+ nacl_ipc_manager_.Init(io_thread_.message_loop_proxy());
#if defined(OS_WIN)
DCHECK(g_listener == NULL);
g_listener = this;
@@ -198,6 +202,17 @@
return;
}
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNaClIPCProxy)) {
+ // Create the server side of the channel and notify the process host so it
+ // can reply to the renderer, which will then try to connect as client.
dmichael (off chromium) 2012/05/10 19:38:58 heh... I think I'm going to need to draw a sequen
bbudge 2012/05/11 01:21:16 I couldn't get it to work creating the channels in
+ IPC::ChannelHandle channel_handle =
+ IPC::Channel::GenerateVerifiedChannelID("nacl");
+ nacl_ppapi_channel_ = nacl_ipc_manager_.CreateChannel(channel_handle);
+
+ Send(new NaClProcessHostMsg_PpapiChannelCreated(channel_handle));
+ }
+
std::vector<nacl::FileDescriptor> handles = params.handles;
#if defined(OS_LINUX) || defined(OS_MACOSX)

Powered by Google App Engine
This is Rietveld 408576698