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

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

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.h
diff --git a/third_party/mojo/src/mojo/edk/test/scoped_ipc_support.h b/third_party/mojo/src/mojo/edk/test/scoped_ipc_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..2569c4e1b5244dedff8d5a7c2b11f17ab863bc5b
--- /dev/null
+++ b/third_party/mojo/src/mojo/edk/test/scoped_ipc_support.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_
+#define MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/waitable_event.h"
+#include "base/task_runner.h"
+#include "mojo/edk/embedder/process_delegate.h"
+
+namespace mojo {
+namespace test {
+
+// A simple class that calls |mojo::embedder::InitIPCSupport()| (with
+// |ProcessType::NONE|) on construction and |ShutdownIPCSupport()| on
+// destruction (or |ShutdownIPCSupportOnIOThread()| if destroyed on the I/O
+// thread).
+// TODO(vtl): Need master/slave versions.
+class ScopedIPCSupport : public embedder::ProcessDelegate {
+ public:
+ ScopedIPCSupport(scoped_refptr<base::TaskRunner> io_thread_task_runner);
+ ~ScopedIPCSupport() override;
+
+ private:
+ // ProcessDelegate| implementation:
+ // Note: Executed on the I/O thread.
+ void OnShutdownComplete() override;
+
+ scoped_refptr<base::TaskRunner> io_thread_task_runner_;
+
+ // Set after shut down.
+ base::WaitableEvent event_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupport);
+};
+
+} // namespace test
+} // namespace mojo
+
+#endif // MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_
« no previous file with comments | « third_party/mojo/src/mojo/edk/test/BUILD.gn ('k') | third_party/mojo/src/mojo/edk/test/scoped_ipc_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698