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

Side by Side Diff: chrome/test/chromedriver/net/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: Rebased, addressed sleevi comments Created 4 years, 9 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/test/chromedriver/net/adb_client_socket.h" 5 #include "chrome/test/chromedriver/net/adb_client_socket.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 370
371 void AdbClientSocket::Connect(const net::CompletionCallback& callback) { 371 void AdbClientSocket::Connect(const net::CompletionCallback& callback) {
372 net::IPAddressNumber ip_number; 372 net::IPAddressNumber ip_number;
373 if (!net::ParseIPLiteralToNumber(host_, &ip_number)) { 373 if (!net::ParseIPLiteralToNumber(host_, &ip_number)) {
374 callback.Run(net::ERR_FAILED); 374 callback.Run(net::ERR_FAILED);
375 return; 375 return;
376 } 376 }
377 377
378 net::AddressList address_list = 378 net::AddressList address_list =
379 net::AddressList::CreateFromIPAddress(ip_number, port_); 379 net::AddressList::CreateFromIPAddress(ip_number, port_);
380 socket_.reset(new net::TCPClientSocket(address_list, NULL, 380 socket_.reset(new net::TCPClientSocket(address_list, NULL, NULL,
381 net::NetLog::Source())); 381 net::NetLog::Source()));
382 int result = socket_->Connect(callback); 382 int result = socket_->Connect(callback);
383 if (result != net::ERR_IO_PENDING) 383 if (result != net::ERR_IO_PENDING)
384 callback.Run(result); 384 callback.Run(result);
385 } 385 }
386 386
387 void AdbClientSocket::SendCommand(const std::string& command, 387 void AdbClientSocket::SendCommand(const std::string& command,
388 bool is_void, 388 bool is_void,
389 bool has_length, 389 bool has_length,
390 const CommandCallback& callback) { 390 const CommandCallback& callback) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 base::Unretained(this), 536 base::Unretained(this),
537 callback, 537 callback,
538 new_response, 538 new_response,
539 response_buffer, 539 response_buffer,
540 bytes_left)); 540 bytes_left));
541 if (result > 0) 541 if (result > 0)
542 OnResponseData(callback, new_response, response_buffer, bytes_left, result); 542 OnResponseData(callback, new_response, response_buffer, bytes_left, result);
543 else if (result != net::ERR_IO_PENDING) 543 else if (result != net::ERR_IO_PENDING)
544 callback.Run(net::OK, new_response); 544 callback.Run(net::OK, new_response);
545 } 545 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698