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

Unified Diff: tools/android/forwarder2/device_controller.cc

Issue 11360248: Use the new forwarder2's Daemon implementation in device_forwarder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address David's comments Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/forwarder2/daemon.cc ('k') | tools/android/forwarder2/device_forwarder_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/forwarder2/device_controller.cc
diff --git a/tools/android/forwarder2/device_controller.cc b/tools/android/forwarder2/device_controller.cc
index 9ab0b48a6c286d710f3ef69d03df569c372571b4..4a197870abfc808668315cfd6eafe355df56d544 100644
--- a/tools/android/forwarder2/device_controller.cc
+++ b/tools/android/forwarder2/device_controller.cc
@@ -64,6 +64,8 @@ void DeviceController::Start() {
if (!kickstart_adb_socket_.exited()) {
LOG(ERROR) << "Could not Accept DeviceController socket: "
<< safe_strerror(errno);
+ } else {
+ LOG(INFO) << "Received exit notification";
}
break;
}
@@ -73,7 +75,6 @@ void DeviceController::Start() {
command::Type command;
if (!ReadCommand(socket.get(), &port, &command)) {
LOG(ERROR) << "Invalid command received.";
- socket->Close();
continue;
}
DeviceListener* listener = listeners_.Lookup(port);
@@ -110,7 +111,6 @@ void DeviceController::Start() {
// After this point it is assumed that, once we close our Adb Data
// socket, the Adb forwarder command will propagate the closing of
// sockets all the way to the host side.
- socket->Close();
continue;
} else if (!listener->SetAdbDataSocket(socket.Pass())) {
LOG(ERROR) << "Could not set Adb Data Socket for port: " << port;
@@ -123,12 +123,10 @@ void DeviceController::Start() {
// TODO(felipeg): add a KillAllListeners command.
LOG(ERROR) << "Invalid command received. Port: " << port
<< " Command: " << command;
- socket->Close();
}
}
KillAllListeners();
CleanUpDeadListeners();
- kickstart_adb_socket_.Close();
}
} // namespace forwarder
« no previous file with comments | « tools/android/forwarder2/daemon.cc ('k') | tools/android/forwarder2/device_forwarder_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698