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

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: 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 (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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 void AdbClientSocket::Connect(const net::CompletionCallback& callback) { 372 void AdbClientSocket::Connect(const net::CompletionCallback& callback) {
373 net::IPAddressNumber ip_number; 373 net::IPAddressNumber ip_number;
374 if (!net::ParseIPLiteralToNumber(host_, &ip_number)) { 374 if (!net::ParseIPLiteralToNumber(host_, &ip_number)) {
375 callback.Run(net::ERR_FAILED); 375 callback.Run(net::ERR_FAILED);
376 return; 376 return;
377 } 377 }
378 378
379 net::AddressList address_list = 379 net::AddressList address_list =
380 net::AddressList::CreateFromIPAddress(ip_number, port_); 380 net::AddressList::CreateFromIPAddress(ip_number, port_);
381 socket_.reset(new net::TCPClientSocket(address_list, NULL, 381 socket_.reset(new net::TCPClientSocket(address_list, NULL, NULL,
382 net::NetLog::Source())); 382 net::NetLog::Source()));
383 int result = socket_->Connect(callback); 383 int result = socket_->Connect(callback);
384 if (result != net::ERR_IO_PENDING) 384 if (result != net::ERR_IO_PENDING)
385 callback.Run(result); 385 callback.Run(result);
386 } 386 }
387 387
388 void AdbClientSocket::SendCommand(const std::string& command, 388 void AdbClientSocket::SendCommand(const std::string& command,
389 bool is_void, 389 bool is_void,
390 bool has_length, 390 bool has_length,
391 const CommandCallback& callback) { 391 const CommandCallback& callback) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 base::Unretained(this), 537 base::Unretained(this),
538 callback, 538 callback,
539 new_response, 539 new_response,
540 response_buffer, 540 response_buffer,
541 bytes_left)); 541 bytes_left));
542 if (result > 0) 542 if (result > 0)
543 OnResponseData(callback, new_response, response_buffer, bytes_left, result); 543 OnResponseData(callback, new_response, response_buffer, bytes_left, result);
544 else if (result != net::ERR_IO_PENDING) 544 else if (result != net::ERR_IO_PENDING)
545 callback.Run(net::OK, new_response); 545 callback.Run(net::OK, new_response);
546 } 546 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698