| 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 <errno.h> | 5 #include <errno.h> |
| 6 #include <signal.h> | 6 #include <signal.h> |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <sys/wait.h> | 10 #include <sys/wait.h> |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 CHECK(pickle_it.ReadString(&device_serial)); | 350 CHECK(pickle_it.ReadString(&device_serial)); |
| 351 int device_port; | 351 int device_port; |
| 352 if (!pickle_it.ReadInt(&device_port)) { | 352 if (!pickle_it.ReadInt(&device_port)) { |
| 353 client_socket->WriteString("ERROR: missing device port"); | 353 client_socket->WriteString("ERROR: missing device port"); |
| 354 return; | 354 return; |
| 355 } | 355 } |
| 356 int host_port; | 356 int host_port; |
| 357 if (!pickle_it.ReadInt(&host_port)) | 357 if (!pickle_it.ReadInt(&host_port)) |
| 358 host_port = -1; | 358 host_port = -1; |
| 359 controllers_manager_.HandleRequest(adb_path_, device_serial, device_port, | 359 controllers_manager_.HandleRequest(adb_path_, device_serial, device_port, |
| 360 host_port, client_socket.Pass()); | 360 host_port, std::move(client_socket)); |
| 361 } | 361 } |
| 362 | 362 |
| 363 private: | 363 private: |
| 364 std::string adb_path_; | 364 std::string adb_path_; |
| 365 bool has_failed_; | 365 bool has_failed_; |
| 366 HostControllersManager controllers_manager_; | 366 HostControllersManager controllers_manager_; |
| 367 | 367 |
| 368 DISALLOW_COPY_AND_ASSIGN(ServerDelegate); | 368 DISALLOW_COPY_AND_ASSIGN(ServerDelegate); |
| 369 }; | 369 }; |
| 370 | 370 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 return client_delegate.has_failed() || daemon_delegate.has_failed(); | 472 return client_delegate.has_failed() || daemon_delegate.has_failed(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace | 475 } // namespace |
| 476 } // namespace forwarder2 | 476 } // namespace forwarder2 |
| 477 | 477 |
| 478 int main(int argc, char** argv) { | 478 int main(int argc, char** argv) { |
| 479 return forwarder2::RunHostForwarder(argc, argv); | 479 return forwarder2::RunHostForwarder(argc, argv); |
| 480 } | 480 } |
| OLD | NEW |