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

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

Issue 2514093002: Mojo EDK: Clean shutdown for ScopedIPCSupport in tests (Closed)
Patch Set: table flip emoji Created 4 years, 1 month 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
« no previous file with comments | « mojo/edk/test/run_all_unittests.cc ('k') | mojo/edk/test/scoped_ipc_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/scoped_ipc_support.h
diff --git a/mojo/edk/test/scoped_ipc_support.h b/mojo/edk/test/scoped_ipc_support.h
index 04173d34528189bc62e570654ddaf43de514621e..c2e57350d98d84263531f9fe3d91463027045c50 100644
--- a/mojo/edk/test/scoped_ipc_support.h
+++ b/mojo/edk/test/scoped_ipc_support.h
@@ -7,10 +7,9 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
-#include "base/run_loop.h"
+#include "base/synchronization/waitable_event.h"
#include "base/task_runner.h"
#include "mojo/edk/embedder/process_delegate.h"
-#include "mojo/edk/embedder/scoped_platform_handle.h"
namespace mojo {
namespace edk {
@@ -18,28 +17,6 @@ namespace test {
base::TaskRunner* GetIoTaskRunner();
-namespace internal {
-
-class ScopedIPCSupportHelper {
- public:
- ScopedIPCSupportHelper();
- ~ScopedIPCSupportHelper();
-
- void Init(ProcessDelegate* process_delegate,
- scoped_refptr<base::TaskRunner> io_thread_task_runner);
-
- void OnShutdownCompleteImpl();
-
- private:
- scoped_refptr<base::TaskRunner> io_thread_task_runner_;
-
- base::RunLoop run_loop_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupportHelper);
-};
-
-} // namespace internal
-
// A simple class that calls |InitIPCSupport()| on construction and
// |ShutdownIPCSupport()| on destruction.
class ScopedIPCSupport : public ProcessDelegate {
@@ -53,7 +30,8 @@ class ScopedIPCSupport : public ProcessDelegate {
// Note: Executed on the I/O thread.
void OnShutdownComplete() override;
- internal::ScopedIPCSupportHelper helper_;
+ base::Closure shutdown_closure_;
+ base::WaitableEvent shutdown_event_;
DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupport);
};
« no previous file with comments | « mojo/edk/test/run_all_unittests.cc ('k') | mojo/edk/test/scoped_ipc_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698