| 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> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 11 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 12 #include "mojo/edk/embedder/scoped_platform_handle.h" | 13 #include "mojo/edk/embedder/scoped_platform_handle.h" |
| 13 #include "mojo/edk/embedder/slave_process_delegate.h" | 14 #include "mojo/edk/embedder/slave_process_delegate.h" |
| 14 #include "mojo/edk/system/connection_manager.h" | 15 #include "mojo/edk/system/connection_manager.h" |
| 15 #include "mojo/edk/system/mutex.h" | 16 #include "mojo/edk/system/mutex.h" |
| 16 #include "mojo/edk/system/raw_channel.h" | 17 #include "mojo/edk/system/raw_channel.h" |
| 17 #include "mojo/edk/system/system_impl_export.h" | 18 #include "mojo/edk/system/system_impl_export.h" |
| 18 #include "mojo/public/cpp/system/macros.h" | 19 #include "mojo/public/cpp/system/macros.h" |
| 19 | 20 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // from the delegate thread.) | 100 // from the delegate thread.) |
| 100 scoped_refptr<base::TaskRunner> delegate_thread_task_runner_; | 101 scoped_refptr<base::TaskRunner> delegate_thread_task_runner_; |
| 101 embedder::SlaveProcessDelegate* slave_process_delegate_; | 102 embedder::SlaveProcessDelegate* slave_process_delegate_; |
| 102 | 103 |
| 103 // This is a private I/O thread on which this class does the bulk of its work. | 104 // This is a private I/O thread on which this class does the bulk of its work. |
| 104 // It is started in |Init()| and terminated in |Shutdown()|. | 105 // It is started in |Init()| and terminated in |Shutdown()|. |
| 105 // TODO(vtl): This isn't really necessary. | 106 // TODO(vtl): This isn't really necessary. |
| 106 base::Thread private_thread_; | 107 base::Thread private_thread_; |
| 107 | 108 |
| 108 // Only accessed on |private_thread_|: | 109 // Only accessed on |private_thread_|: |
| 109 scoped_ptr<RawChannel> raw_channel_; | 110 std::unique_ptr<RawChannel> raw_channel_; |
| 110 enum AwaitingAckType { | 111 enum AwaitingAckType { |
| 111 NOT_AWAITING_ACK, | 112 NOT_AWAITING_ACK, |
| 112 AWAITING_ACCEPT_CONNECT_ACK, | 113 AWAITING_ACCEPT_CONNECT_ACK, |
| 113 AWAITING_CANCEL_CONNECT_ACK, | 114 AWAITING_CANCEL_CONNECT_ACK, |
| 114 AWAITING_CONNECT_ACK | 115 AWAITING_CONNECT_ACK |
| 115 }; | 116 }; |
| 116 AwaitingAckType awaiting_ack_type_; | 117 AwaitingAckType awaiting_ack_type_; |
| 117 Result* ack_result_; | 118 Result* ack_result_; |
| 118 // Used only when waiting for the ack to "connect": | 119 // Used only when waiting for the ack to "connect": |
| 119 ProcessIdentifier* ack_peer_process_identifier_; | 120 ProcessIdentifier* ack_peer_process_identifier_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 149 Mutex mutex_; | 150 Mutex mutex_; |
| 150 base::WaitableEvent event_; | 151 base::WaitableEvent event_; |
| 151 | 152 |
| 152 MOJO_DISALLOW_COPY_AND_ASSIGN(SlaveConnectionManager); | 153 MOJO_DISALLOW_COPY_AND_ASSIGN(SlaveConnectionManager); |
| 153 }; | 154 }; |
| 154 | 155 |
| 155 } // namespace system | 156 } // namespace system |
| 156 } // namespace mojo | 157 } // namespace mojo |
| 157 | 158 |
| 158 #endif // MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_ | 159 #endif // MOJO_EDK_SYSTEM_SLAVE_CONNECTION_MANAGER_H_ |
| OLD | NEW |