| 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 #include "tools/android/forwarder2/host_controller.h" | 5 #include "tools/android/forwarder2/host_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 << device_port; | 51 << device_port; |
| 52 return host_controller; | 52 return host_controller; |
| 53 } | 53 } |
| 54 host_controller.reset(new HostController( | 54 host_controller.reset(new HostController( |
| 55 device_serial, device_port_allocated, host_port, adb_port, error_callback, | 55 device_serial, device_port_allocated, host_port, adb_port, error_callback, |
| 56 std::move(adb_control_socket), std::move(delete_controller_notifier))); | 56 std::move(adb_control_socket), std::move(delete_controller_notifier))); |
| 57 return host_controller; | 57 return host_controller; |
| 58 } | 58 } |
| 59 | 59 |
| 60 HostController::~HostController() { | 60 HostController::~HostController() { |
| 61 DCHECK(deletion_task_runner_->RunsTasksOnCurrentThread()); | 61 DCHECK(deletion_task_runner_->RunsTasksInCurrentSequence()); |
| 62 delete_controller_notifier_->Notify(); | 62 delete_controller_notifier_->Notify(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void HostController::Start() { | 65 void HostController::Start() { |
| 66 thread_.Start(); | 66 thread_.Start(); |
| 67 ReadNextCommandSoon(); | 67 ReadNextCommandSoon(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 HostController::HostController( | 70 HostController::HostController( |
| 71 const std::string& device_serial, | 71 const std::string& device_serial, |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 178 } |
| 179 if (!ReceivedCommandWithTimeout(command::UNLISTEN_SUCCESS, &socket, 10)) { | 179 if (!ReceivedCommandWithTimeout(command::UNLISTEN_SUCCESS, &socket, 10)) { |
| 180 LOG(ERROR) << device_serial_ | 180 LOG(ERROR) << device_serial_ |
| 181 << ": Unmap command failed for port " | 181 << ": Unmap command failed for port " |
| 182 << device_port_; | 182 << device_port_; |
| 183 return; | 183 return; |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace forwarder2 | 187 } // namespace forwarder2 |
| OLD | NEW |