summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-11-16 17:06:04 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-17 01:06:44 +0000
commitf48f69860e1df7384126a7ec1ad6029927e12f6d (patch)
treeebae586bd3a2c782af2e85018cd6afd8b5240216
parentc97dbd99e5e53bfed4aee0b6c179b9cb88ffe75b (diff)
downloadchromium_src-f48f69860e1df7384126a7ec1ad6029927e12f6d.zip
chromium_src-f48f69860e1df7384126a7ec1ad6029927e12f6d.tar.gz
chromium_src-f48f69860e1df7384126a7ec1ad6029927e12f6d.tar.bz2
Fix the new Mojo EDK working in component build on Linux.
BUG=478251 Review URL: https://codereview.chromium.org/1450183002 Cr-Commit-Position: refs/heads/master@{#359966}
-rw-r--r--components/nacl/BUILD.gn7
-rw-r--r--ipc/mojo/ipc_channel_mojo.cc22
-rw-r--r--third_party/mojo/src/mojo/edk/embedder/embedder.cc3
3 files changed, 9 insertions, 23 deletions
diff --git a/components/nacl/BUILD.gn b/components/nacl/BUILD.gn
index bff29a2..8d72407 100644
--- a/components/nacl/BUILD.gn
+++ b/components/nacl/BUILD.gn
@@ -38,12 +38,7 @@ if (enable_nacl) {
"//ppapi/c",
"//ppapi/proxy:ipc",
"//ppapi/shared_impl",
- "//third_party/mojo/src/mojo/edk/embedder",
-
- # TODO(use_chrome_edk): so that EDK in third_party can choose the EDK in
- # src/mojo if the command line flag is specified. It has to since we can
- # only have one definition of the Mojo primitives.
- "//mojo/edk/embedder",
+ "//third_party/mojo/src/mojo/edk/system",
]
if (enable_nacl_untrusted) {
diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc
index 05ce419..8ae0de5 100644
--- a/ipc/mojo/ipc_channel_mojo.cc
+++ b/ipc/mojo/ipc_channel_mojo.cc
@@ -16,7 +16,6 @@
#include "ipc/mojo/client_channel.mojom.h"
#include "ipc/mojo/ipc_mojo_bootstrap.h"
#include "ipc/mojo/ipc_mojo_handle_attachment.h"
-#include "mojo/edk/embedder/embedder.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
@@ -70,14 +69,9 @@ class ClientChannelMojo : public ChannelMojo, public ClientChannel {
void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle,
int32 peer_pid) override {
if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
- mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle(
-#if defined(OS_WIN)
- handle.release().handle));
-#else
- handle.release().fd));
-#endif
- InitMessageReader(
- mojo::edk::CreateMessagePipe(edk_handle.Pass()), peer_pid);
+ InitMessageReader(mojo::embedder::CreateChannel(
+ handle.Pass(), base::Callback<void(mojo::embedder::ChannelInfo*)>(),
+ scoped_refptr<base::TaskRunner>()), peer_pid);
return;
}
CreateMessagingPipe(handle.Pass(), base::Bind(&ClientChannelMojo::BindPipe,
@@ -125,13 +119,9 @@ class ServerChannelMojo : public ChannelMojo {
void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle,
int32 peer_pid) override {
if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
- mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle(
-#if defined(OS_WIN)
- handle.release().handle));
-#else
- handle.release().fd));
-#endif
- message_pipe_ = mojo::edk::CreateMessagePipe(edk_handle.Pass());
+ message_pipe_ = mojo::embedder::CreateChannel(
+ handle.Pass(), base::Callback<void(mojo::embedder::ChannelInfo*)>(),
+ scoped_refptr<base::TaskRunner>());
if (!message_pipe_.is_valid()) {
LOG(WARNING) << "mojo::CreateMessagePipe failed: ";
listener()->OnChannelError();
diff --git a/third_party/mojo/src/mojo/edk/embedder/embedder.cc b/third_party/mojo/src/mojo/edk/embedder/embedder.cc
index d12f2f2..8fcf6e0 100644
--- a/third_party/mojo/src/mojo/edk/embedder/embedder.cc
+++ b/third_party/mojo/src/mojo/edk/embedder/embedder.cc
@@ -321,7 +321,8 @@ ScopedMessagePipeHandle CreateChannel(
DCHECK(internal::g_ipc_support);
if (UseNewEDK()) {
- did_create_channel_callback.Run(nullptr);
+ if (!did_create_channel_callback.is_null())
+ did_create_channel_callback.Run(nullptr);
mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle(
#if defined(OS_WIN)
platform_handle.release().handle));