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

Unified Diff: content/browser/mojo/mojo_application_host.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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: content/browser/mojo/mojo_application_host.cc
diff --git a/content/browser/mojo/mojo_application_host.cc b/content/browser/mojo/mojo_application_host.cc
index b1a9382f9adfd02e361b142e79b3f1731343699a..802915c8c544e013314e87502787889a1e941b69 100644
--- a/content/browser/mojo/mojo_application_host.cc
+++ b/content/browser/mojo/mojo_application_host.cc
@@ -7,11 +7,26 @@
#include "content/common/mojo/mojo_messages.h"
#include "content/public/browser/browser_thread.h"
#include "ipc/ipc_sender.h"
+
+#if defined(USE_CHROME_EDK)
+#include "mojo/edk/embedder/platform_channel_pair.h"
+#else
#include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h"
+#endif
namespace content {
namespace {
+#if defined(USE_CHROME_EDK)
+base::PlatformFile PlatformFileFromScopedPlatformHandle(
+ mojo::edk::ScopedPlatformHandle handle) {
+#if defined(OS_POSIX)
+ return handle.release().fd;
+#elif defined(OS_WIN)
+ return handle.release().handle;
+#endif
+}
+#else
base::PlatformFile PlatformFileFromScopedPlatformHandle(
mojo::embedder::ScopedPlatformHandle handle) {
#if defined(OS_POSIX)
@@ -20,6 +35,7 @@ base::PlatformFile PlatformFileFromScopedPlatformHandle(
return handle.release().handle;
#endif
}
+#endif
class ApplicationSetupImpl : public ApplicationSetup {
public:
@@ -60,8 +76,11 @@ MojoApplicationHost::~MojoApplicationHost() {
bool MojoApplicationHost::Init() {
DCHECK(!client_handle_.is_valid()) << "Already initialized!";
-
+#if defined(USE_CHROME_EDK)
+ mojo::edk::PlatformChannelPair channel_pair;
+#else
mojo::embedder::PlatformChannelPair channel_pair;
+#endif
scoped_refptr<base::TaskRunner> io_task_runner;
if (io_task_runner_override_) {

Powered by Google App Engine
This is Rietveld 408576698