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

Side by Side Diff: blimp/net/tcp_client_transport.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/net/tcp_client_transport.h" 5 #include "blimp/net/tcp_client_transport.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 17 matching lines...) Expand all
28 DCHECK(factory); 28 DCHECK(factory);
29 socket_factory_ = factory; 29 socket_factory_ = factory;
30 } 30 }
31 31
32 void TCPClientTransport::Connect(const net::CompletionCallback& callback) { 32 void TCPClientTransport::Connect(const net::CompletionCallback& callback) {
33 DCHECK(!socket_); 33 DCHECK(!socket_);
34 DCHECK(!callback.is_null()); 34 DCHECK(!callback.is_null());
35 35
36 connect_callback_ = callback; 36 connect_callback_ = callback;
37 socket_ = socket_factory_->CreateTransportClientSocket( 37 socket_ = socket_factory_->CreateTransportClientSocket(
38 net::AddressList(ip_endpoint_), net_log_, net::NetLog::Source()); 38 net::AddressList(ip_endpoint_), nullptr, net_log_, net::NetLog::Source());
39 net::CompletionCallback completion_callback = base::Bind( 39 net::CompletionCallback completion_callback = base::Bind(
40 &TCPClientTransport::OnTCPConnectComplete, base::Unretained(this)); 40 &TCPClientTransport::OnTCPConnectComplete, base::Unretained(this));
41 41
42 int result = socket_->Connect(completion_callback); 42 int result = socket_->Connect(completion_callback);
43 if (result == net::ERR_IO_PENDING) { 43 if (result == net::ERR_IO_PENDING) {
44 return; 44 return;
45 } 45 }
46 46
47 OnTCPConnectComplete(result); 47 OnTCPConnectComplete(result);
48 } 48 }
(...skipping 27 matching lines...) Expand all
76 void TCPClientTransport::SetSocket(scoped_ptr<net::StreamSocket> socket) { 76 void TCPClientTransport::SetSocket(scoped_ptr<net::StreamSocket> socket) {
77 DCHECK(socket); 77 DCHECK(socket);
78 socket_ = std::move(socket); 78 socket_ = std::move(socket);
79 } 79 }
80 80
81 net::ClientSocketFactory* TCPClientTransport::socket_factory() const { 81 net::ClientSocketFactory* TCPClientTransport::socket_factory() const {
82 return socket_factory_; 82 return socket_factory_;
83 } 83 }
84 84
85 } // namespace blimp 85 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698