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

Side by Side Diff: chrome/browser/devtools/device/adb/adb_client_socket.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed net tests compilation issues, Added tests Created 4 years, 10 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/adb/adb_client_socket.h" 5 #include "chrome/browser/devtools/device/adb/adb_client_socket.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void AdbClientSocket::Connect(const net::CompletionCallback& callback) { 175 void AdbClientSocket::Connect(const net::CompletionCallback& callback) {
176 net::IPAddressNumber ip_number; 176 net::IPAddressNumber ip_number;
177 if (!net::ParseIPLiteralToNumber(host_, &ip_number)) { 177 if (!net::ParseIPLiteralToNumber(host_, &ip_number)) {
178 callback.Run(net::ERR_FAILED); 178 callback.Run(net::ERR_FAILED);
179 return; 179 return;
180 } 180 }
181 181
182 net::AddressList address_list = 182 net::AddressList address_list =
183 net::AddressList::CreateFromIPAddress(ip_number, port_); 183 net::AddressList::CreateFromIPAddress(ip_number, port_);
184 socket_.reset(new net::TCPClientSocket(address_list, NULL, 184 socket_.reset(new net::TCPClientSocket(address_list, NULL, NULL,
bengr 2016/02/08 18:51:14 There aren't a lot of uses of NULL in this file so
tbansal1 2016/02/08 21:33:26 This CL is already huge :(. So, I would prefer not
bengr 2016/02/08 23:42:06 Acknowledged.
185 net::NetLog::Source())); 185 net::NetLog::Source()));
bengr 2016/02/08 18:51:14 Also, /* inline comments */ would be helpful next
tbansal1 2016/02/08 21:33:26 I think inline comments are discouraged in Chromiu
bengr 2016/02/08 23:42:06 I've seen it both ways in Chromium, but I'll defer
tbansal1 2016/02/09 17:11:22 Acknowledged.
186 int result = socket_->Connect(callback); 186 int result = socket_->Connect(callback);
187 if (result != net::ERR_IO_PENDING) 187 if (result != net::ERR_IO_PENDING)
188 callback.Run(result); 188 callback.Run(result);
189 } 189 }
190 190
191 void AdbClientSocket::SendCommand(const std::string& command, 191 void AdbClientSocket::SendCommand(const std::string& command,
192 bool is_void, 192 bool is_void,
193 const CommandCallback& callback) { 193 const CommandCallback& callback) {
194 scoped_refptr<net::StringIOBuffer> request_buffer = 194 scoped_refptr<net::StringIOBuffer> request_buffer =
195 new net::StringIOBuffer(EncodeMessage(command)); 195 new net::StringIOBuffer(EncodeMessage(command));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 base::Unretained(this), 292 base::Unretained(this),
293 callback, 293 callback,
294 new_response, 294 new_response,
295 response_buffer, 295 response_buffer,
296 bytes_left)); 296 bytes_left));
297 if (result > 0) 297 if (result > 0)
298 OnResponseData(callback, new_response, response_buffer, bytes_left, result); 298 OnResponseData(callback, new_response, response_buffer, bytes_left, result);
299 else if (result != net::ERR_IO_PENDING) 299 else if (result != net::ERR_IO_PENDING)
300 callback.Run(net::OK, new_response); 300 callback.Run(net::OK, new_response);
301 } 301 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/devtools/device/port_forwarding_controller.cc » ('j') | net/base/network_quality_estimator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698