Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Side by Side Diff: net/socket/websocket_transport_client_socket_pool.cc

Issue 1149763005: Change NetLog::ParametersCallback to return a scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments on ownership removed Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/spdy/spdy_header_block.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/spdy/spdy_header_block.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698