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

Side by Side Diff: mojo/edk/system/slave_connection_manager.h

Issue 1526063003: EDK: Add TaskRunner and PlatformHandleWatcher to RawChannel. (Closed) Base URL: https://github.com/domokit/mojo.git@channel_watcher
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/system/raw_channel_unittest.cc ('k') | mojo/edk/system/slave_connection_manager.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_SYSTEM_SLAVE_CONNECTION_MANAGER_H_ 5 #ifndef MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_
6 #define MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_ 6 #define MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "mojo/edk/embedder/slave_process_delegate.h" 10 #include "mojo/edk/embedder/slave_process_delegate.h"
(...skipping 10 matching lines...) Expand all
21 class TaskRunner; 21 class TaskRunner;
22 } 22 }
23 23
24 namespace mojo { 24 namespace mojo {
25 25
26 namespace embedder { 26 namespace embedder {
27 class SlaveProcessDelegate; 27 class SlaveProcessDelegate;
28 } 28 }
29 29
30 namespace platform { 30 namespace platform {
31 class PlatformHandleWatcher;
31 class Thread; 32 class Thread;
32 } 33 }
33 34
34 namespace system { 35 namespace system {
35 36
36 // The |ConnectionManager| implementation for slave processes. 37 // The |ConnectionManager| implementation for slave processes.
37 // 38 //
38 // This class is thread-safe (except that no public methods may be called from 39 // This class is thread-safe (except that no public methods may be called from
39 // its internal, private thread), with condition that |Init()| be called before 40 // its internal, private thread), with condition that |Init()| be called before
40 // anything else and |Shutdown()| be called before destruction (and no other 41 // anything else and |Shutdown()| be called before destruction (and no other
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // |private_thread_|. (Note that |slave_process_delegate_| may only be called 103 // |private_thread_|. (Note that |slave_process_delegate_| may only be called
103 // from the delegate thread.) 104 // from the delegate thread.)
104 util::RefPtr<platform::TaskRunner> delegate_thread_task_runner_; 105 util::RefPtr<platform::TaskRunner> delegate_thread_task_runner_;
105 embedder::SlaveProcessDelegate* slave_process_delegate_; 106 embedder::SlaveProcessDelegate* slave_process_delegate_;
106 107
107 // This is a private I/O thread on which this class does the bulk of its work. 108 // This is a private I/O thread on which this class does the bulk of its work.
108 // It is started in |Init()| and terminated in |Shutdown()|. 109 // It is started in |Init()| and terminated in |Shutdown()|.
109 // TODO(vtl): This isn't really necessary. 110 // TODO(vtl): This isn't really necessary.
110 std::unique_ptr<platform::Thread> private_thread_; 111 std::unique_ptr<platform::Thread> private_thread_;
111 util::RefPtr<platform::TaskRunner> private_thread_task_runner_; 112 util::RefPtr<platform::TaskRunner> private_thread_task_runner_;
113 platform::PlatformHandleWatcher* private_thread_platform_handle_watcher_;
112 114
113 // Only accessed on |private_thread_|: 115 // Only accessed on |private_thread_|:
114 std::unique_ptr<RawChannel> raw_channel_; 116 std::unique_ptr<RawChannel> raw_channel_;
115 enum AwaitingAckType { 117 enum AwaitingAckType {
116 NOT_AWAITING_ACK, 118 NOT_AWAITING_ACK,
117 AWAITING_ACCEPT_CONNECT_ACK, 119 AWAITING_ACCEPT_CONNECT_ACK,
118 AWAITING_CANCEL_CONNECT_ACK, 120 AWAITING_CANCEL_CONNECT_ACK,
119 AWAITING_CONNECT_ACK 121 AWAITING_CONNECT_ACK
120 }; 122 };
121 AwaitingAckType awaiting_ack_type_; 123 AwaitingAckType awaiting_ack_type_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 util::Mutex mutex_; 156 util::Mutex mutex_;
155 util::AutoResetWaitableEvent event_; 157 util::AutoResetWaitableEvent event_;
156 158
157 MOJO_DISALLOW_COPY_AND_ASSIGN(SlaveConnectionManager); 159 MOJO_DISALLOW_COPY_AND_ASSIGN(SlaveConnectionManager);
158 }; 160 };
159 161
160 } // namespace system 162 } // namespace system
161 } // namespace mojo 163 } // namespace mojo
162 164
163 #endif // MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_ 165 #endif // MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/raw_channel_unittest.cc ('k') | mojo/edk/system/slave_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698