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

Side by Side Diff: net/socket/websocket_transport_connect_sub_job.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 "net/socket/websocket_transport_connect_sub_job.h" 5 #include "net/socket/websocket_transport_connect_sub_job.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/log/net_log.h" 10 #include "net/log/net_log.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 next_state_ = STATE_TRANSPORT_CONNECT; 130 next_state_ = STATE_TRANSPORT_CONNECT;
131 return OK; 131 return OK;
132 } 132 }
133 133
134 int WebSocketTransportConnectSubJob::DoTransportConnect() { 134 int WebSocketTransportConnectSubJob::DoTransportConnect() {
135 // TODO(ricea): Update global g_last_connect_time and report 135 // TODO(ricea): Update global g_last_connect_time and report
136 // ConnectInterval. 136 // ConnectInterval.
137 next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE; 137 next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE;
138 AddressList one_address(CurrentAddress()); 138 AddressList one_address(CurrentAddress());
139 transport_socket_ = client_socket_factory()->CreateTransportClientSocket( 139 transport_socket_ = client_socket_factory()->CreateTransportClientSocket(
140 one_address, net_log().net_log(), net_log().source()); 140 one_address, nullptr, net_log().net_log(), net_log().source());
141 // This use of base::Unretained() is safe because transport_socket_ is 141 // This use of base::Unretained() is safe because transport_socket_ is
142 // destroyed in the destructor. 142 // destroyed in the destructor.
143 return transport_socket_->Connect(base::Bind( 143 return transport_socket_->Connect(base::Bind(
144 &WebSocketTransportConnectSubJob::OnIOComplete, base::Unretained(this))); 144 &WebSocketTransportConnectSubJob::OnIOComplete, base::Unretained(this)));
145 } 145 }
146 146
147 int WebSocketTransportConnectSubJob::DoTransportConnectComplete(int result) { 147 int WebSocketTransportConnectSubJob::DoTransportConnectComplete(int result) {
148 next_state_ = STATE_DONE; 148 next_state_ = STATE_DONE;
149 WebSocketEndpointLockManager* endpoint_lock_manager = 149 WebSocketEndpointLockManager* endpoint_lock_manager =
150 WebSocketEndpointLockManager::GetInstance(); 150 WebSocketEndpointLockManager::GetInstance();
(...skipping 10 matching lines...) Expand all
161 return result; 161 return result;
162 } 162 }
163 163
164 endpoint_lock_manager->RememberSocket(transport_socket_.get(), 164 endpoint_lock_manager->RememberSocket(transport_socket_.get(),
165 CurrentAddress()); 165 CurrentAddress());
166 166
167 return result; 167 return result;
168 } 168 }
169 169
170 } // namespace net 170 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/websocket_transport_client_socket_pool.cc ('k') | net/test/embedded_test_server/embedded_test_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698