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

Unified Diff: ppapi/nacl_irt/ppapi_dispatcher.cc

Issue 2148633002: Pass around IPC::ChannelHandles instead of raw fds in the NaCl IRT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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 | « ppapi/nacl_irt/ppapi_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/nacl_irt/ppapi_dispatcher.cc
diff --git a/ppapi/nacl_irt/ppapi_dispatcher.cc b/ppapi/nacl_irt/ppapi_dispatcher.cc
index 8fd69bc10b9abea9e4cb9d9ace3e5e846e674f30..789a75ce5daf94c24383b794e491755a7b93cb47 100644
--- a/ppapi/nacl_irt/ppapi_dispatcher.cc
+++ b/ppapi/nacl_irt/ppapi_dispatcher.cc
@@ -34,15 +34,12 @@ namespace ppapi {
PpapiDispatcher::PpapiDispatcher(
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
base::WaitableEvent* shutdown_event,
- int browser_ipc_fd,
- int renderer_ipc_fd)
+ IPC::ChannelHandle browser_ipc_handle,
+ IPC::ChannelHandle renderer_ipc_handle)
: next_plugin_dispatcher_id_(0),
task_runner_(io_task_runner),
shutdown_event_(shutdown_event),
- renderer_ipc_fd_(renderer_ipc_fd) {
- IPC::ChannelHandle channel_handle(
- "NaCl IPC", base::FileDescriptor(browser_ipc_fd, false));
-
+ renderer_ipc_handle_(renderer_ipc_handle) {
proxy::PluginGlobals* globals = proxy::PluginGlobals::Get();
// Delay initializing the SyncChannel until after we add filters. This
// ensures that the filters won't miss any messages received by
@@ -56,7 +53,7 @@ PpapiDispatcher::PpapiDispatcher(
globals->RegisterResourceMessageFilters(plugin_filter.get());
channel_->AddFilter(new tracing::ChildTraceMessageFilter(task_runner_.get()));
- channel_->Init(channel_handle, IPC::Channel::MODE_SERVER, true);
+ channel_->Init(browser_ipc_handle, IPC::Channel::MODE_SERVER, true);
}
base::SingleThreadTaskRunner* PpapiDispatcher::GetIPCTaskRunner() {
@@ -184,11 +181,8 @@ void PpapiDispatcher::OnMsgInitializeNaClDispatcher(
proxy::PluginDispatcher* dispatcher =
new proxy::PluginDispatcher(::PPP_GetInterface, args.permissions,
args.off_the_record);
- IPC::ChannelHandle channel_handle(
- "nacl",
- base::FileDescriptor(renderer_ipc_fd_, false));
if (!dispatcher->InitPluginWithChannel(this, base::kNullProcessId,
- channel_handle, false)) {
+ renderer_ipc_handle_, false)) {
delete dispatcher;
return;
}
« no previous file with comments | « ppapi/nacl_irt/ppapi_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698