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

Unified Diff: mojo/runner/context.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: mojo/runner/context.cc
diff --git a/mojo/runner/context.cc b/mojo/runner/context.cc
index b6d78e333d17a9def89f69a54854344420758ecb..b6cd6ca905f8d8fc6940e038213530c153ea6bc2 100644
--- a/mojo/runner/context.cc
+++ b/mojo/runner/context.cc
@@ -27,8 +27,6 @@
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/common/trace_controller_impl.h"
#include "mojo/common/tracing_impl.h"
-#include "mojo/edk/embedder/embedder.h"
-#include "mojo/edk/embedder/simple_platform_support.h"
#include "mojo/package_manager/package_manager_impl.h"
#include "mojo/runner/in_process_native_runner.h"
#include "mojo/runner/out_of_process_native_runner.h"
@@ -42,6 +40,14 @@
#include "mojo/util/filename_util.h"
#include "url/gurl.h"
+#if defined(USE_CHROME_EDK)
+#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/simple_platform_support.h"
+#else
+#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
+#include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h"
+#endif
+
namespace mojo {
namespace runner {
namespace {
@@ -50,7 +56,11 @@ namespace {
class Setup {
public:
Setup() {
+#if defined(USE_CHROME_EDK)
+ edk::Init(make_scoped_ptr(new edk::SimplePlatformSupport()));
+#else
embedder::Init(make_scoped_ptr(new embedder::SimplePlatformSupport()));
+#endif
}
~Setup() {}
@@ -185,10 +195,16 @@ bool Context::Init() {
task_runners_.reset(
new TaskRunners(base::MessageLoop::current()->task_runner()));
+#if defined(USE_CHROME_EDK)
+ edk::InitIPCSupport(
+ task_runners_->shell_runner(), this, task_runners_->io_runner(),
+ edk::ScopedPlatformHandle());
+#else
// TODO(vtl): This should be MASTER, not NONE.
embedder::InitIPCSupport(
embedder::ProcessType::NONE, task_runners_->shell_runner(), this,
task_runners_->io_runner(), embedder::ScopedPlatformHandle());
+#endif
package_manager_ = new package_manager::PackageManagerImpl(shell_file_root_);
InitContentHandlers(package_manager_, command_line);
@@ -244,7 +260,11 @@ void Context::Shutdown() {
TRACE_EVENT0("mojo_shell", "Context::Shutdown");
DCHECK_EQ(base::MessageLoop::current()->task_runner(),
task_runners_->shell_runner());
+#if defined(USE_CHROME_EDK)
+ edk::ShutdownIPCSupport();
+#else
embedder::ShutdownIPCSupport();
+#endif
// We'll quit when we get OnShutdownComplete().
base::MessageLoop::current()->Run();
}

Powered by Google App Engine
This is Rietveld 408576698