| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 390 } |
| 391 | 391 |
| 392 void WebSocketTransportClientSocketPool::CancelRequest( | 392 void WebSocketTransportClientSocketPool::CancelRequest( |
| 393 const std::string& group_name, | 393 const std::string& group_name, |
| 394 ClientSocketHandle* handle) { | 394 ClientSocketHandle* handle) { |
| 395 DCHECK(!handle->is_initialized()); | 395 DCHECK(!handle->is_initialized()); |
| 396 if (DeleteStalledRequest(handle)) | 396 if (DeleteStalledRequest(handle)) |
| 397 return; | 397 return; |
| 398 std::unique_ptr<StreamSocket> socket = handle->PassSocket(); | 398 std::unique_ptr<StreamSocket> socket = handle->PassSocket(); |
| 399 if (socket) | 399 if (socket) |
| 400 ReleaseSocket(handle->group_name(), std::move(socket), handle->id()); | 400 ReleaseSocket(handle->group_name(), std::move(socket), handle->id(), |
| 401 handle->connect_timing()); |
| 401 if (!DeleteJob(handle)) | 402 if (!DeleteJob(handle)) |
| 402 pending_callbacks_.erase(handle); | 403 pending_callbacks_.erase(handle); |
| 403 | 404 |
| 404 ActivateStalledRequest(); | 405 ActivateStalledRequest(); |
| 405 } | 406 } |
| 406 | 407 |
| 407 void WebSocketTransportClientSocketPool::ReleaseSocket( | 408 void WebSocketTransportClientSocketPool::ReleaseSocket( |
| 408 const std::string& group_name, | 409 const std::string& group_name, |
| 409 std::unique_ptr<StreamSocket> socket, | 410 std::unique_ptr<StreamSocket> socket, |
| 410 int id) { | 411 int id, |
| 412 const LoadTimingInfo::ConnectTiming& connect_timing) { |
| 411 WebSocketEndpointLockManager::GetInstance()->UnlockSocket(socket.get()); | 413 WebSocketEndpointLockManager::GetInstance()->UnlockSocket(socket.get()); |
| 412 CHECK_GT(handed_out_socket_count_, 0); | 414 CHECK_GT(handed_out_socket_count_, 0); |
| 413 --handed_out_socket_count_; | 415 --handed_out_socket_count_; |
| 414 | 416 |
| 415 ActivateStalledRequest(); | 417 ActivateStalledRequest(); |
| 416 } | 418 } |
| 417 | 419 |
| 418 void WebSocketTransportClientSocketPool::FlushWithError(int error) { | 420 void WebSocketTransportClientSocketPool::FlushWithError(int error) { |
| 419 DCHECK_NE(error, OK); | 421 DCHECK_NE(error, OK); |
| 420 | 422 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 handle(handle), | 696 handle(handle), |
| 695 callback(callback), | 697 callback(callback), |
| 696 net_log(net_log) {} | 698 net_log(net_log) {} |
| 697 | 699 |
| 698 WebSocketTransportClientSocketPool::StalledRequest::StalledRequest( | 700 WebSocketTransportClientSocketPool::StalledRequest::StalledRequest( |
| 699 const StalledRequest& other) = default; | 701 const StalledRequest& other) = default; |
| 700 | 702 |
| 701 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} | 703 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} |
| 702 | 704 |
| 703 } // namespace net | 705 } // namespace net |
| OLD | NEW |