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

Side by Side Diff: mojo/edk/test/scoped_ipc_support.h

Issue 1483823004: EDK: Move {platform_handle,scoped_platform_handle}.* to //mojo/edk/platform. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper_unittest.cc ('k') | mojo/edk/test/scoped_ipc_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_ 5 #ifndef MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_
6 #define MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_ 6 #define MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "mojo/edk/embedder/master_process_delegate.h" 9 #include "mojo/edk/embedder/master_process_delegate.h"
10 #include "mojo/edk/embedder/process_delegate.h" 10 #include "mojo/edk/embedder/process_delegate.h"
11 #include "mojo/edk/embedder/process_type.h" 11 #include "mojo/edk/embedder/process_type.h"
12 #include "mojo/edk/embedder/scoped_platform_handle.h"
13 #include "mojo/edk/embedder/slave_process_delegate.h" 12 #include "mojo/edk/embedder/slave_process_delegate.h"
13 #include "mojo/edk/platform/scoped_platform_handle.h"
14 #include "mojo/edk/platform/task_runner.h" 14 #include "mojo/edk/platform/task_runner.h"
15 #include "mojo/edk/util/ref_ptr.h" 15 #include "mojo/edk/util/ref_ptr.h"
16 #include "mojo/edk/util/waitable_event.h" 16 #include "mojo/edk/util/waitable_event.h"
17 #include "mojo/public/cpp/system/macros.h" 17 #include "mojo/public/cpp/system/macros.h"
18 18
19 namespace mojo { 19 namespace mojo {
20 namespace test { 20 namespace test {
21 21
22 namespace internal { 22 namespace internal {
23 23
24 class ScopedIPCSupportHelper final { 24 class ScopedIPCSupportHelper final {
25 public: 25 public:
26 ScopedIPCSupportHelper(); 26 ScopedIPCSupportHelper();
27 ~ScopedIPCSupportHelper(); 27 ~ScopedIPCSupportHelper();
28 28
29 void Init(embedder::ProcessType process_type, 29 void Init(embedder::ProcessType process_type,
30 embedder::ProcessDelegate* process_delegate, 30 embedder::ProcessDelegate* process_delegate,
31 util::RefPtr<platform::TaskRunner>&& io_thread_task_runner, 31 util::RefPtr<platform::TaskRunner>&& io_thread_task_runner,
32 embedder::ScopedPlatformHandle platform_handle); 32 platform::ScopedPlatformHandle platform_handle);
33 33
34 void OnShutdownCompleteImpl(); 34 void OnShutdownCompleteImpl();
35 35
36 private: 36 private:
37 util::RefPtr<platform::TaskRunner> io_thread_task_runner_; 37 util::RefPtr<platform::TaskRunner> io_thread_task_runner_;
38 38
39 // Set after shut down. 39 // Set after shut down.
40 util::ManualResetWaitableEvent event_; 40 util::ManualResetWaitableEvent event_;
41 41
42 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupportHelper); 42 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupportHelper);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedMasterIPCSupport); 87 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedMasterIPCSupport);
88 }; 88 };
89 89
90 // Like |ScopedIPCSupport|, but with |ProcessType::SLAVE|. It will (optionally) 90 // Like |ScopedIPCSupport|, but with |ProcessType::SLAVE|. It will (optionally)
91 // call a callback (on the I/O thread) on receiving |OnMasterDisconnect()|. 91 // call a callback (on the I/O thread) on receiving |OnMasterDisconnect()|.
92 class ScopedSlaveIPCSupport final : public embedder::SlaveProcessDelegate { 92 class ScopedSlaveIPCSupport final : public embedder::SlaveProcessDelegate {
93 public: 93 public:
94 ScopedSlaveIPCSupport( 94 ScopedSlaveIPCSupport(
95 util::RefPtr<platform::TaskRunner>&& io_thread_task_runner, 95 util::RefPtr<platform::TaskRunner>&& io_thread_task_runner,
96 embedder::ScopedPlatformHandle platform_handle); 96 platform::ScopedPlatformHandle platform_handle);
97 ScopedSlaveIPCSupport( 97 ScopedSlaveIPCSupport(
98 util::RefPtr<platform::TaskRunner>&& io_thread_task_runner, 98 util::RefPtr<platform::TaskRunner>&& io_thread_task_runner,
99 embedder::ScopedPlatformHandle platform_handle, 99 platform::ScopedPlatformHandle platform_handle,
100 base::Closure on_master_disconnect); 100 base::Closure on_master_disconnect);
101 ~ScopedSlaveIPCSupport() override; 101 ~ScopedSlaveIPCSupport() override;
102 102
103 private: 103 private:
104 // |SlaveProcessDelegate| implementation: 104 // |SlaveProcessDelegate| implementation:
105 // Note: Executed on the I/O thread. 105 // Note: Executed on the I/O thread.
106 void OnShutdownComplete() override; 106 void OnShutdownComplete() override;
107 void OnMasterDisconnect() override; 107 void OnMasterDisconnect() override;
108 108
109 internal::ScopedIPCSupportHelper helper_; 109 internal::ScopedIPCSupportHelper helper_;
110 base::Closure on_master_disconnect_; 110 base::Closure on_master_disconnect_;
111 111
112 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedSlaveIPCSupport); 112 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedSlaveIPCSupport);
113 }; 113 };
114 114
115 } // namespace test 115 } // namespace test
116 } // namespace mojo 116 } // namespace mojo
117 117
118 #endif // MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_ 118 #endif // MOJO_EDK_TEST_SCOPED_IPC_SUPPORT_H_
OLDNEW
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper_unittest.cc ('k') | mojo/edk/test/scoped_ipc_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698