| 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 <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 } | 482 } |
| 483 | 483 |
| 484 if (!forwarding_map_.empty()) { | 484 if (!forwarding_map_.empty()) { |
| 485 UpdateConnections(); | 485 UpdateConnections(); |
| 486 } else { | 486 } else { |
| 487 std::vector<Connection*> registry_copy; | 487 std::vector<Connection*> registry_copy; |
| 488 for (Registry::iterator it = registry_.begin(); | 488 for (Registry::iterator it = registry_.begin(); |
| 489 it != registry_.end(); ++it) { | 489 it != registry_.end(); ++it) { |
| 490 registry_copy.push_back(it->second); | 490 registry_copy.push_back(it->second); |
| 491 } | 491 } |
| 492 STLDeleteElements(®istry_copy); | 492 base::STLDeleteElements(®istry_copy); |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 | 495 |
| 496 void PortForwardingController::UpdateConnections() { | 496 void PortForwardingController::UpdateConnections() { |
| 497 for (Registry::iterator it = registry_.begin(); it != registry_.end(); ++it) | 497 for (Registry::iterator it = registry_.begin(); it != registry_.end(); ++it) |
| 498 it->second->UpdateForwardingMap(forwarding_map_); | 498 it->second->UpdateForwardingMap(forwarding_map_); |
| 499 } | 499 } |
| OLD | NEW |