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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const std::string& group_name, | 353 const std::string& group_name, |
354 const void* params, | 354 const void* params, |
355 int num_sockets, | 355 int num_sockets, |
356 const BoundNetLog& net_log) { | 356 const BoundNetLog& net_log) { |
357 NOTIMPLEMENTED(); | 357 NOTIMPLEMENTED(); |
358 } | 358 } |
359 | 359 |
360 void WebSocketTransportClientSocketPool::CancelRequest( | 360 void WebSocketTransportClientSocketPool::CancelRequest( |
361 const std::string& group_name, | 361 const std::string& group_name, |
362 ClientSocketHandle* handle) { | 362 ClientSocketHandle* handle) { |
| 363 DCHECK(!handle->is_initialized()); |
363 if (DeleteStalledRequest(handle)) | 364 if (DeleteStalledRequest(handle)) |
364 return; | 365 return; |
| 366 scoped_ptr<StreamSocket> socket = handle->PassSocket(); |
| 367 if (socket) |
| 368 ReleaseSocket(handle->group_name(), socket.Pass(), handle->id()); |
365 if (!DeleteJob(handle)) | 369 if (!DeleteJob(handle)) |
366 pending_callbacks_.erase(handle); | 370 pending_callbacks_.erase(handle); |
367 if (!ReachedMaxSocketsLimit() && !stalled_request_queue_.empty()) | 371 if (!ReachedMaxSocketsLimit() && !stalled_request_queue_.empty()) |
368 ActivateStalledRequest(); | 372 ActivateStalledRequest(); |
369 } | 373 } |
370 | 374 |
371 void WebSocketTransportClientSocketPool::ReleaseSocket( | 375 void WebSocketTransportClientSocketPool::ReleaseSocket( |
372 const std::string& group_name, | 376 const std::string& group_name, |
373 scoped_ptr<StreamSocket> socket, | 377 scoped_ptr<StreamSocket> socket, |
374 int id) { | 378 int id) { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 const BoundNetLog& net_log) | 639 const BoundNetLog& net_log) |
636 : params(params), | 640 : params(params), |
637 priority(priority), | 641 priority(priority), |
638 handle(handle), | 642 handle(handle), |
639 callback(callback), | 643 callback(callback), |
640 net_log(net_log) {} | 644 net_log(net_log) {} |
641 | 645 |
642 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} | 646 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} |
643 | 647 |
644 } // namespace net | 648 } // namespace net |
OLD | NEW |