OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/devtools/device/port_forwarding_controller.h" | 5 #include "chrome/browser/devtools/device/port_forwarding_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 bool ProcessResponse(const std::string& json); | 287 bool ProcessResponse(const std::string& json); |
288 | 288 |
289 void ProcessBindResponse(int port, PortStatus status); | 289 void ProcessBindResponse(int port, PortStatus status); |
290 void ProcessUnbindResponse(int port, PortStatus status); | 290 void ProcessUnbindResponse(int port, PortStatus status); |
291 | 291 |
292 static void UpdateSocketCountOnHandlerThread( | 292 static void UpdateSocketCountOnHandlerThread( |
293 base::WeakPtr<Connection> weak_connection, int port, int increment); | 293 base::WeakPtr<Connection> weak_connection, int port, int increment); |
294 void UpdateSocketCount(int port, int increment); | 294 void UpdateSocketCount(int port, int increment); |
295 | 295 |
296 // DevToolsAndroidBridge::AndroidWebSocket::Delegate implementation: | 296 // DevToolsAndroidBridge::AndroidWebSocket::Delegate implementation: |
297 virtual void OnSocketOpened() OVERRIDE; | 297 virtual void OnSocketOpened() override; |
298 virtual void OnFrameRead(const std::string& message) OVERRIDE; | 298 virtual void OnFrameRead(const std::string& message) override; |
299 virtual void OnSocketClosed() OVERRIDE; | 299 virtual void OnSocketClosed() override; |
300 | 300 |
301 PortForwardingController::Registry* registry_; | 301 PortForwardingController::Registry* registry_; |
302 scoped_refptr<DevToolsAndroidBridge::RemoteDevice> device_; | 302 scoped_refptr<DevToolsAndroidBridge::RemoteDevice> device_; |
303 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser_; | 303 scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser_; |
304 scoped_ptr<DevToolsAndroidBridge::AndroidWebSocket> web_socket_; | 304 scoped_ptr<DevToolsAndroidBridge::AndroidWebSocket> web_socket_; |
305 int command_id_; | 305 int command_id_; |
306 bool connected_; | 306 bool connected_; |
307 ForwardingMap forwarding_map_; | 307 ForwardingMap forwarding_map_; |
308 CommandCallbackMap pending_responses_; | 308 CommandCallbackMap pending_responses_; |
309 PortStatusMap port_status_; | 309 PortStatusMap port_status_; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 registry_copy.push_back(it->second); | 586 registry_copy.push_back(it->second); |
587 } | 587 } |
588 STLDeleteElements(®istry_copy); | 588 STLDeleteElements(®istry_copy); |
589 } | 589 } |
590 } | 590 } |
591 | 591 |
592 void PortForwardingController::UpdateConnections() { | 592 void PortForwardingController::UpdateConnections() { |
593 for (Registry::iterator it = registry_.begin(); it != registry_.end(); ++it) | 593 for (Registry::iterator it = registry_.begin(); it != registry_.end(); ++it) |
594 it->second->UpdateForwardingMap(forwarding_map_); | 594 it->second->UpdateForwardingMap(forwarding_map_); |
595 } | 595 } |
OLD | NEW |