| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |