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_client_socket_pool.h" | 5 #include "net/socket/websocket_transport_client_socket_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 DCHECK(pending_connects_.empty()); | 254 DCHECK(pending_connects_.empty()); |
255 DCHECK_EQ(0, handed_out_socket_count_); | 255 DCHECK_EQ(0, handed_out_socket_count_); |
256 DCHECK(stalled_request_queue_.empty()); | 256 DCHECK(stalled_request_queue_.empty()); |
257 DCHECK(stalled_request_map_.empty()); | 257 DCHECK(stalled_request_map_.empty()); |
258 } | 258 } |
259 | 259 |
260 // static | 260 // static |
261 void WebSocketTransportClientSocketPool::UnlockEndpoint( | 261 void WebSocketTransportClientSocketPool::UnlockEndpoint( |
262 ClientSocketHandle* handle) { | 262 ClientSocketHandle* handle) { |
263 DCHECK(handle->is_initialized()); | 263 DCHECK(handle->is_initialized()); |
264 WebSocketEndpointLockManager::GetInstance()->UnlockSocket(handle->socket()); | 264 DCHECK(handle->socket()); |
| 265 IPEndPoint address; |
| 266 if (handle->socket()->GetPeerAddress(&address) == OK) |
| 267 WebSocketEndpointLockManager::GetInstance()->UnlockEndpoint(address); |
265 } | 268 } |
266 | 269 |
267 int WebSocketTransportClientSocketPool::RequestSocket( | 270 int WebSocketTransportClientSocketPool::RequestSocket( |
268 const std::string& group_name, | 271 const std::string& group_name, |
269 const void* params, | 272 const void* params, |
270 RequestPriority priority, | 273 RequestPriority priority, |
271 ClientSocketHandle* handle, | 274 ClientSocketHandle* handle, |
272 const CompletionCallback& callback, | 275 const CompletionCallback& callback, |
273 const BoundNetLog& request_net_log) { | 276 const BoundNetLog& request_net_log) { |
274 DCHECK(params); | 277 DCHECK(params); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 const BoundNetLog& net_log) | 642 const BoundNetLog& net_log) |
640 : params(params), | 643 : params(params), |
641 priority(priority), | 644 priority(priority), |
642 handle(handle), | 645 handle(handle), |
643 callback(callback), | 646 callback(callback), |
644 net_log(net_log) {} | 647 net_log(net_log) {} |
645 | 648 |
646 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} | 649 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} |
647 | 650 |
648 } // namespace net | 651 } // namespace net |
OLD | NEW |