Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: tools/android/forwarder2/host_forwarder_main.cc

Issue 2366763003: [Android] Add device serial to all host_controller log messages. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/android/forwarder2/host_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if (controllers_->find(controller_key) != controllers_->end()) { 192 if (controllers_->find(controller_key) != controllers_->end()) {
193 LOG(INFO) << "Already forwarding device port " << device_port 193 LOG(INFO) << "Already forwarding device port " << device_port
194 << " to host port " << host_port; 194 << " to host port " << host_port;
195 SendMessage(base::StringPrintf("%d:%d", device_port, host_port), 195 SendMessage(base::StringPrintf("%d:%d", device_port, host_port),
196 client_socket.get()); 196 client_socket.get());
197 return; 197 return;
198 } 198 }
199 } 199 }
200 // Create a new host controller. 200 // Create a new host controller.
201 std::unique_ptr<HostController> host_controller(HostController::Create( 201 std::unique_ptr<HostController> host_controller(HostController::Create(
202 device_port, host_port, adb_port, GetExitNotifierFD(), 202 device_serial, device_port, host_port, adb_port, GetExitNotifierFD(),
203 base::Bind(&HostControllersManager::DeleteHostController, 203 base::Bind(&HostControllersManager::DeleteHostController,
204 weak_ptr_factory_.GetWeakPtr()))); 204 weak_ptr_factory_.GetWeakPtr())));
205 if (!host_controller.get()) { 205 if (!host_controller.get()) {
206 has_failed_ = true; 206 has_failed_ = true;
207 SendMessage("ERROR: Connection to device failed.\n", client_socket.get()); 207 SendMessage("ERROR: Connection to device failed.\n", client_socket.get());
208 LogExistingControllers(client_socket); 208 LogExistingControllers(client_socket);
209 return; 209 return;
210 } 210 }
211 // Get the current allocated port. 211 // Get the current allocated port.
212 device_port = host_controller->device_port(); 212 device_port = host_controller->device_port();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « tools/android/forwarder2/host_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698