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

Unified Diff: components/nacl/loader/nacl_listener.cc

Issue 2151153002: Use ChannelMojo for NaCl IRT channels in non-sfi mode. Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-nacl-channel-mojo
Patch Set: rebase 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 | « components/nacl/browser/nacl_process_host.cc ('k') | components/nacl/loader/nonsfi/nonsfi_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nacl_listener.cc
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc
index daf5766c80a8fd7a25819dd2f73796f6aba52bc4..9ff19730127a920c78100f1655d8bac675215004 100644
--- a/components/nacl/loader/nacl_listener.cc
+++ b/components/nacl/loader/nacl_listener.cc
@@ -42,7 +42,6 @@
#include "native_client/src/public/nacl_desc.h"
#if defined(OS_POSIX)
-#include "base/file_descriptor_posix.h"
#include "base/posix/global_descriptors.h"
#include "content/public/common/content_descriptors.h"
#endif
@@ -117,13 +116,13 @@ void SetUpIPCAdapter(
int nacl_fd,
NaClIPCAdapter::ResolveFileTokenCallback resolve_file_token_cb,
NaClIPCAdapter::OpenResourceCallback open_resource_cb) {
+ IPC::ChannelHandle client_handle;
+ IPC::Channel::GenerateMojoChannelHandlePair(
+ "nacl", handle, &client_handle);
scoped_refptr<NaClIPCAdapter> ipc_adapter(new NaClIPCAdapter(
*handle, task_runner.get(), resolve_file_token_cb, open_resource_cb));
ipc_adapter->ConnectChannel();
-#if defined(OS_POSIX)
- handle->socket =
- base::FileDescriptor(ipc_adapter->TakeClientFileDescriptor());
-#endif
+ *handle = client_handle;
// Pass a NaClDesc to the untrusted side. This will hold a ref to the
// NaClIPCAdapter.
@@ -336,12 +335,9 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
LOG(FATAL) << "NaClAppCreate() failed";
}
- IPC::ChannelHandle browser_handle =
- IPC::Channel::GenerateVerifiedChannelID("nacl");
- IPC::ChannelHandle ppapi_renderer_handle =
- IPC::Channel::GenerateVerifiedChannelID("nacl");
- IPC::ChannelHandle manifest_service_handle =
- IPC::Channel::GenerateVerifiedChannelID("nacl");
+ IPC::ChannelHandle browser_handle;
+ IPC::ChannelHandle ppapi_renderer_handle;
+ IPC::ChannelHandle manifest_service_handle;
// Create the PPAPI IPC channels between the NaCl IRT and the host
// (browser/renderer) processes. The IRT uses these channels to
@@ -360,13 +356,17 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
base::Bind(&NaClListener::ResolveFileToken, base::Unretained(this)),
base::Bind(&NaClListener::OnOpenResource, base::Unretained(this)));
+ IPC::ChannelHandle trusted_client;
+ IPC::ChannelHandle trusted_server;
+ IPC::Channel::GenerateMojoChannelHandlePair("NaCl-trusted-listener",
+ &trusted_client, &trusted_server);
trusted_listener_ =
- new NaClTrustedListener(IPC::Channel::GenerateVerifiedChannelID("nacl"),
+ new NaClTrustedListener(trusted_server,
io_thread_.task_runner().get(), &shutdown_event_);
if (!Send(new NaClProcessHostMsg_PpapiChannelsCreated(
browser_handle,
ppapi_renderer_handle,
- trusted_listener_->TakeClientChannelHandle(),
+ trusted_client,
manifest_service_handle)))
LOG(FATAL) << "Failed to send IPC channel handle to NaClProcessHost.";
« no previous file with comments | « components/nacl/browser/nacl_process_host.cc ('k') | components/nacl/loader/nonsfi/nonsfi_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698