OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |