Index: chrome/browser/devtools/port_forwarding_controller.cc |
diff --git a/chrome/browser/devtools/port_forwarding_controller.cc b/chrome/browser/devtools/port_forwarding_controller.cc |
index d7faa46bc39a17c8003d99ff9ce306ae4a941890..f53d6b83e1d4511624b91b0acd8fa4093deb49a5 100644 |
--- a/chrome/browser/devtools/port_forwarding_controller.cc |
+++ b/chrome/browser/devtools/port_forwarding_controller.cc |
@@ -595,16 +595,18 @@ PortForwardingController::UpdateDeviceList( |
for (DevToolsAdbBridge::RemoteDevices::const_iterator it = devices.begin(); |
it != devices.end(); ++it) { |
scoped_refptr<DevToolsAdbBridge::RemoteDevice> device = *it; |
- Registry::iterator rit = registry_.find(device->serial()); |
+ if (!device->IsConnected()) |
+ continue; |
+ Registry::iterator rit = registry_.find(device->GetSerial()); |
if (rit == registry_.end()) { |
std::string socket = FindBestSocketForTethering(device->browsers()); |
- if (!socket.empty() || device->serial().empty()) { |
+ if (!socket.empty() || device->GetSerial().empty()) { |
// Will delete itself when disconnected. |
new Connection( |
®istry_, device->device(), socket, adb_thread_, pref_service_); |
} |
} else { |
- status[device->serial()] = (*rit).second->GetPortStatusMap(); |
+ status[device->GetSerial()] = (*rit).second->GetPortStatusMap(); |
} |
} |
return status; |