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

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: 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/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 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 void AdbClientSocket::Connect(const net::CompletionCallback& callback) { 177 void AdbClientSocket::Connect(const net::CompletionCallback& callback) {
178 net::IPAddress ip_address; 178 net::IPAddress ip_address;
179 if (!ip_address.AssignFromIPLiteral(host_)) { 179 if (!ip_address.AssignFromIPLiteral(host_)) {
180 callback.Run(net::ERR_FAILED); 180 callback.Run(net::ERR_FAILED);
181 return; 181 return;
182 } 182 }
183 183
184 net::AddressList address_list = 184 net::AddressList address_list =
185 net::AddressList::CreateFromIPAddress(ip_address, port_); 185 net::AddressList::CreateFromIPAddress(ip_address, port_);
186 socket_.reset(new net::TCPClientSocket(address_list, NULL, 186 socket_.reset(new net::TCPClientSocket(address_list, NULL, NULL,
187 net::NetLog::Source())); 187 net::NetLog::Source()));
188 int result = socket_->Connect(callback); 188 int result = socket_->Connect(callback);
189 if (result != net::ERR_IO_PENDING) 189 if (result != net::ERR_IO_PENDING)
190 callback.Run(result); 190 callback.Run(result);
191 } 191 }
192 192
193 void AdbClientSocket::SendCommand(const std::string& command, 193 void AdbClientSocket::SendCommand(const std::string& command,
194 bool is_void, 194 bool is_void,
195 const CommandCallback& callback) { 195 const CommandCallback& callback) {
196 scoped_refptr<net::StringIOBuffer> request_buffer = 196 scoped_refptr<net::StringIOBuffer> request_buffer =
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 base::Unretained(this), 294 base::Unretained(this),
295 callback, 295 callback,
296 new_response, 296 new_response,
297 response_buffer, 297 response_buffer,
298 bytes_left)); 298 bytes_left));
299 if (result > 0) 299 if (result > 0)
300 OnResponseData(callback, new_response, response_buffer, bytes_left, result); 300 OnResponseData(callback, new_response, response_buffer, bytes_left, result);
301 else if (result != net::ERR_IO_PENDING) 301 else if (result != net::ERR_IO_PENDING)
302 callback.Run(net::OK, new_response); 302 callback.Run(net::OK, new_response);
303 } 303 }
OLDNEW
« no previous file with comments | « blimp/net/tcp_client_transport.cc ('k') | chrome/browser/devtools/device/port_forwarding_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698