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

Side by Side Diff: chrome/browser/devtools/device/port_forwarding_controller.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorder initialization in constructor Created 4 years, 8 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
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (result != net::ERR_IO_PENDING) 76 if (result != net::ERR_IO_PENDING)
77 OnResolved(result); 77 OnResolved(result);
78 } 78 }
79 79
80 void OnResolved(int result) { 80 void OnResolved(int result) {
81 if (result < 0) { 81 if (result < 0) {
82 SelfDestruct(); 82 SelfDestruct();
83 return; 83 return;
84 } 84 }
85 85
86 host_socket_.reset(new net::TCPClientSocket(address_list_, nullptr, 86 host_socket_.reset(new net::TCPClientSocket(address_list_, nullptr, nullptr,
87 net::NetLog::Source())); 87 net::NetLog::Source()));
88 result = host_socket_->Connect(base::Bind(&SocketTunnel::OnConnected, 88 result = host_socket_->Connect(base::Bind(&SocketTunnel::OnConnected,
89 base::Unretained(this))); 89 base::Unretained(this)));
90 if (result != net::ERR_IO_PENDING) 90 if (result != net::ERR_IO_PENDING)
91 OnConnected(result); 91 OnConnected(result);
92 } 92 }
93 93
94 void OnConnected(int result) { 94 void OnConnected(int result) {
95 if (result < 0) { 95 if (result < 0) {
96 SelfDestruct(); 96 SelfDestruct();
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 registry_copy.push_back(it->second); 492 registry_copy.push_back(it->second);
493 } 493 }
494 STLDeleteElements(&registry_copy); 494 STLDeleteElements(&registry_copy);
495 } 495 }
496 } 496 }
497 497
498 void PortForwardingController::UpdateConnections() { 498 void PortForwardingController::UpdateConnections() {
499 for (Registry::iterator it = registry_.begin(); it != registry_.end(); ++it) 499 for (Registry::iterator it = registry_.begin(); it != registry_.end(); ++it)
500 it->second->UpdateForwardingMap(forwarding_map_); 500 it->second->UpdateForwardingMap(forwarding_map_);
501 } 501 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/adb/adb_client_socket.cc ('k') | chrome/browser/devtools/device/tcp_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698