| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ | 5 #ifndef TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ |
| 6 #define TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ | 6 #define TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 int device_port, | 60 int device_port, |
| 61 int host_port, | 61 int host_port, |
| 62 int adb_port, | 62 int adb_port, |
| 63 const ErrorCallback& error_callback, | 63 const ErrorCallback& error_callback, |
| 64 std::unique_ptr<Socket> adb_control_socket, | 64 std::unique_ptr<Socket> adb_control_socket, |
| 65 std::unique_ptr<PipeNotifier> delete_controller_notifier); | 65 std::unique_ptr<PipeNotifier> delete_controller_notifier); |
| 66 | 66 |
| 67 void ReadNextCommandSoon(); | 67 void ReadNextCommandSoon(); |
| 68 void ReadCommandOnInternalThread(); | 68 void ReadCommandOnInternalThread(); |
| 69 | 69 |
| 70 void StartForwarder(std::unique_ptr<Socket> host_server_data_socket); | 70 bool StartForwarder(std::unique_ptr<Socket> host_server_data_socket); |
| 71 | 71 |
| 72 // Note that this gets also called when ~HostController() is invoked. | 72 // Note that this gets also called when ~HostController() is invoked. |
| 73 void OnInternalThreadError(); | 73 void OnInternalThreadError(); |
| 74 | 74 |
| 75 void UnmapPortOnDevice(); | 75 void UnmapPortOnDevice(); |
| 76 | 76 |
| 77 SelfDeleterHelper<HostController> self_deleter_helper_; | 77 SelfDeleterHelper<HostController> self_deleter_helper_; |
| 78 const std::string device_serial_; | 78 const std::string device_serial_; |
| 79 const int device_port_; | 79 const int device_port_; |
| 80 const int host_port_; | 80 const int host_port_; |
| 81 const int adb_port_; | 81 const int adb_port_; |
| 82 std::unique_ptr<Socket> adb_control_socket_; | 82 std::unique_ptr<Socket> adb_control_socket_; |
| 83 // Used to cancel the pending blocking IO operations when the host controller | 83 // Used to cancel the pending blocking IO operations when the host controller |
| 84 // instance is deleted. | 84 // instance is deleted. |
| 85 std::unique_ptr<PipeNotifier> delete_controller_notifier_; | 85 std::unique_ptr<PipeNotifier> delete_controller_notifier_; |
| 86 // Task runner used for deletion set at deletion time (i.e. the object is | 86 // Task runner used for deletion set at deletion time (i.e. the object is |
| 87 // deleted on the same thread it is created on). | 87 // deleted on the same thread it is created on). |
| 88 const scoped_refptr<base::SingleThreadTaskRunner> deletion_task_runner_; | 88 const scoped_refptr<base::SingleThreadTaskRunner> deletion_task_runner_; |
| 89 base::Thread thread_; | 89 base::Thread thread_; |
| 90 ForwardersManager forwarders_manager_; | 90 ForwardersManager forwarders_manager_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(HostController); | 92 DISALLOW_COPY_AND_ASSIGN(HostController); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace forwarder2 | 95 } // namespace forwarder2 |
| 96 | 96 |
| 97 #endif // TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ | 97 #endif // TOOLS_ANDROID_FORWARDER2_HOST_CONTROLLER_H_ |
| OLD | NEW |