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

Unified Diff: ppapi/nacl_irt/plugin_startup.cc

Issue 2025763002: Use ChannelMojo in Pepper and NaCl processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-utility-channel-mojo
Patch Set: iujbhirtughfbnjrthiubj Created 4 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 | « ppapi/nacl_irt/plugin_startup.h ('k') | ppapi/proxy/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/nacl_irt/plugin_startup.cc
diff --git a/ppapi/nacl_irt/plugin_startup.cc b/ppapi/nacl_irt/plugin_startup.cc
index 338f524608f767035087d3c207e8445fdc32d1da..1026efd5339bddc0a7a13ba549bbf3fbacb3a04b 100644
--- a/ppapi/nacl_irt/plugin_startup.cc
+++ b/ppapi/nacl_irt/plugin_startup.cc
@@ -12,6 +12,8 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "ipc/ipc_channel_handle.h"
+#include "ipc/mojo/scoped_ipc_support.h"
+#include "mojo/edk/embedder/embedder.h"
#include "ppapi/nacl_irt/manifest_service.h"
#include "ppapi/shared_impl/ppb_audio_shared.h"
@@ -21,6 +23,7 @@ namespace {
int g_nacl_browser_ipc_fd = -1;
int g_nacl_renderer_ipc_fd = -1;
int g_manifest_service_fd = -1;
+int g_nacl_browser_mojo_fd = -1;
base::WaitableEvent* g_shutdown_event = NULL;
base::Thread* g_io_thread = NULL;
@@ -48,14 +51,17 @@ void StartUpManifestServiceOnIOThread(base::WaitableEvent* event) {
} // namespace
void SetIPCFileDescriptors(
- int browser_ipc_fd, int renderer_ipc_fd, int manifest_service_fd) {
+ int browser_ipc_fd, int renderer_ipc_fd, int manifest_service_fd,
+ int browser_mojo_fd) {
// The initialization must be only once.
DCHECK_EQ(g_nacl_browser_ipc_fd, -1);
DCHECK_EQ(g_nacl_renderer_ipc_fd, -1);
DCHECK_EQ(g_manifest_service_fd, -1);
+ DCHECK_EQ(g_nacl_browser_mojo_fd, -1);
g_nacl_browser_ipc_fd = browser_ipc_fd;
g_nacl_renderer_ipc_fd = renderer_ipc_fd;
g_manifest_service_fd = manifest_service_fd;
+ g_nacl_browser_mojo_fd = browser_mojo_fd;
}
void StartUpPlugin() {
@@ -68,6 +74,15 @@ void StartUpPlugin() {
g_io_thread->StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
+ // Initialize Mojo.
+ mojo::edk::Init();
+ IPC::ScopedIPCSupport scoped_ipc_support(g_io_thread->task_runner());
+ if (g_nacl_browser_mojo_fd != -1) {
+ LOG(ERROR) << "Setting up Mojo channel in NaCl";
+// mojo::edk::SetParentPipeHandle(mojo::edk::ScopedPlatformHandle(
+// mojo::edk::PlatformHandle(g_nacl_browser_mojo_fd)));
+ }
+
if (g_manifest_service_fd != -1) {
// Manifest service must be created on IOThread so that the main message
// handling will be done on the thread, which has a message loop
« no previous file with comments | « ppapi/nacl_irt/plugin_startup.h ('k') | ppapi/proxy/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698