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

Unified Diff: third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use run_renderer_in_process() Created 5 years, 10 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: third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc
diff --git a/third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc b/third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9f3b97d7579a3b2fa8dd3db435f6bb80bc1a2aca
--- /dev/null
+++ b/third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc
@@ -0,0 +1,38 @@
+// Copyright 2015 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/edk/test/scoped_ipc_support.h"
+
+#include "base/message_loop/message_loop.h"
+#include "mojo/edk/embedder/embedder.h"
+
+namespace mojo {
+namespace test {
+
+ScopedIPCSupport::ScopedIPCSupport(
+ scoped_refptr<base::TaskRunner> io_thread_task_runner)
+ : io_thread_task_runner_(io_thread_task_runner),
+ event_(true, false) { // Manual reset.
+ // Note: Run delegate methods on the I/O thread.
+ embedder::InitIPCSupport(embedder::ProcessType::NONE, io_thread_task_runner,
+ this, io_thread_task_runner,
+ embedder::ScopedPlatformHandle());
+}
+
+ScopedIPCSupport::~ScopedIPCSupport() {
+ if (base::MessageLoop::current() &&
+ base::MessageLoop::current()->task_runner() == io_thread_task_runner_) {
+ embedder::ShutdownIPCSupportOnIOThread();
+ } else {
+ embedder::ShutdownIPCSupport();
+ event_.Wait();
+ }
+}
+
+void ScopedIPCSupport::OnShutdownComplete() {
+ event_.Signal();
+}
+
+} // namespace test
+} // namespace mojo
« no previous file with comments | « third_party/mojo/src/mojo/edk/test/scoped_ipc_support.h ('k') | third_party/mojo/src/mojo/public/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698