Index: mojo/shell/runner/host/child_process_base.cc |
diff --git a/mojo/shell/runner/host/child_process_base.cc b/mojo/shell/runner/host/child_process_base.cc |
deleted file mode 100644 |
index e6b9a2529fcc2942c7d9f7ee7b85a1538c725b5e..0000000000000000000000000000000000000000 |
--- a/mojo/shell/runner/host/child_process_base.cc |
+++ /dev/null |
@@ -1,72 +0,0 @@ |
-// Copyright 2014 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-#include "mojo/shell/runner/host/child_process_base.h" |
- |
-#include "base/logging.h" |
-#include "base/macros.h" |
-#include "base/memory/ref_counted.h" |
-#include "base/message_loop/message_loop.h" |
-#include "base/single_thread_task_runner.h" |
-#include "base/synchronization/waitable_event.h" |
-#include "base/threading/thread.h" |
-#include "mojo/edk/embedder/embedder.h" |
-#include "mojo/edk/embedder/process_delegate.h" |
-#include "mojo/shell/runner/common/client_util.h" |
- |
-namespace mojo { |
-namespace shell { |
- |
-namespace { |
- |
-// Should be created and initialized on the main thread and kept alive as long |
-// a Mojo application is running in the current process. |
-class ScopedAppContext : public edk::ProcessDelegate { |
- public: |
- ScopedAppContext() |
- : io_thread_("io_thread"), wait_for_shutdown_event_(true, false) { |
- // Initialize Mojo before starting any threads. |
- edk::Init(); |
- |
- // Create and start our I/O thread. |
- base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); |
- CHECK(io_thread_.StartWithOptions(io_thread_options)); |
- io_runner_ = io_thread_.task_runner().get(); |
- CHECK(io_runner_.get()); |
- |
- edk::InitIPCSupport(this, io_runner_); |
- edk::SetParentPipeHandleFromCommandLine(); |
- } |
- |
- ~ScopedAppContext() override { |
- edk::ShutdownIPCSupport(); |
- wait_for_shutdown_event_.Wait(); |
- } |
- |
- private: |
- // ProcessDelegate implementation. |
- void OnShutdownComplete() override { |
- wait_for_shutdown_event_.Signal(); |
- } |
- |
- base::Thread io_thread_; |
- scoped_refptr<base::SingleThreadTaskRunner> io_runner_; |
- |
- // Used to unblock the main thread on shutdown. |
- base::WaitableEvent wait_for_shutdown_event_; |
- |
- DISALLOW_COPY_AND_ASSIGN(ScopedAppContext); |
-}; |
- |
-} // namespace |
- |
-void ChildProcessMain(const RunCallback& callback) { |
- DCHECK(!base::MessageLoop::current()); |
- |
- ScopedAppContext app_context; |
- callback.Run(GetShellClientRequestFromCommandLine()); |
-} |
- |
-} // namespace shell |
-} // namespace mojo |