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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET; | 429 return LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET; |
430 if (pending_callbacks_.count(handle)) | 430 if (pending_callbacks_.count(handle)) |
431 return LOAD_STATE_CONNECTING; | 431 return LOAD_STATE_CONNECTING; |
432 return LookupConnectJob(handle)->GetLoadState(); | 432 return LookupConnectJob(handle)->GetLoadState(); |
433 } | 433 } |
434 | 434 |
435 base::DictionaryValue* WebSocketTransportClientSocketPool::GetInfoAsValue( | 435 base::DictionaryValue* WebSocketTransportClientSocketPool::GetInfoAsValue( |
436 const std::string& name, | 436 const std::string& name, |
437 const std::string& type, | 437 const std::string& type, |
438 bool include_nested_pools) const { | 438 bool include_nested_pools) const { |
439 base::DictionaryValue* dict = new base::DictionaryValue(); | 439 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
440 dict->SetString("name", name); | 440 dict->SetString("name", name); |
441 dict->SetString("type", type); | 441 dict->SetString("type", type); |
442 dict->SetInteger("handed_out_socket_count", handed_out_socket_count_); | 442 dict->SetInteger("handed_out_socket_count", handed_out_socket_count_); |
443 dict->SetInteger("connecting_socket_count", pending_connects_.size()); | 443 dict->SetInteger("connecting_socket_count", pending_connects_.size()); |
444 dict->SetInteger("idle_socket_count", 0); | 444 dict->SetInteger("idle_socket_count", 0); |
445 dict->SetInteger("max_socket_count", max_sockets_); | 445 dict->SetInteger("max_socket_count", max_sockets_); |
446 dict->SetInteger("max_sockets_per_group", max_sockets_); | 446 dict->SetInteger("max_sockets_per_group", max_sockets_); |
447 dict->SetInteger("pool_generation_number", 0); | 447 dict->SetInteger("pool_generation_number", 0); |
448 return dict; | 448 return dict.release(); |
449 } | 449 } |
450 | 450 |
451 TimeDelta WebSocketTransportClientSocketPool::ConnectionTimeout() const { | 451 TimeDelta WebSocketTransportClientSocketPool::ConnectionTimeout() const { |
452 return TimeDelta::FromSeconds(kTransportConnectJobTimeoutInSeconds); | 452 return TimeDelta::FromSeconds(kTransportConnectJobTimeoutInSeconds); |
453 } | 453 } |
454 | 454 |
455 bool WebSocketTransportClientSocketPool::IsStalled() const { | 455 bool WebSocketTransportClientSocketPool::IsStalled() const { |
456 return !stalled_request_queue_.empty(); | 456 return !stalled_request_queue_.empty(); |
457 } | 457 } |
458 | 458 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 const BoundNetLog& net_log) | 634 const BoundNetLog& net_log) |
635 : params(params), | 635 : params(params), |
636 priority(priority), | 636 priority(priority), |
637 handle(handle), | 637 handle(handle), |
638 callback(callback), | 638 callback(callback), |
639 net_log(net_log) {} | 639 net_log(net_log) {} |
640 | 640 |
641 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} | 641 WebSocketTransportClientSocketPool::StalledRequest::~StalledRequest() {} |
642 | 642 |
643 } // namespace net | 643 } // namespace net |
OLD | NEW |