Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/socks_client_socket_pool.h" | 5 #include "net/socket/socks_client_socket_pool.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 int SOCKSClientSocketPool::IdleSocketCountInGroup( | 259 int SOCKSClientSocketPool::IdleSocketCountInGroup( |
| 260 const std::string& group_name) const { | 260 const std::string& group_name) const { |
| 261 return base_.IdleSocketCountInGroup(group_name); | 261 return base_.IdleSocketCountInGroup(group_name); |
| 262 } | 262 } |
| 263 | 263 |
| 264 LoadState SOCKSClientSocketPool::GetLoadState( | 264 LoadState SOCKSClientSocketPool::GetLoadState( |
| 265 const std::string& group_name, const ClientSocketHandle* handle) const { | 265 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 266 return base_.GetLoadState(group_name, handle); | 266 return base_.GetLoadState(group_name, handle); |
| 267 } | 267 } |
| 268 | 268 |
| 269 base::DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue( | 269 scoped_ptr<base::DictionaryValue> SOCKSClientSocketPool::GetInfoAsValue( |
| 270 const std::string& name, | 270 const std::string& name, |
| 271 const std::string& type, | 271 const std::string& type, |
| 272 bool include_nested_pools) const { | 272 bool include_nested_pools) const { |
| 273 base::DictionaryValue* dict = base_.GetInfoAsValue(name, type); | 273 scoped_ptr<base::DictionaryValue> |
| 274 dict(base_.GetInfoAsValue(name, type).Pass()); | |
|
eroman
2015/06/01 17:07:23
No need for Pass()
| |
| 274 if (include_nested_pools) { | 275 if (include_nested_pools) { |
| 275 scoped_ptr<base::ListValue> list(new base::ListValue()); | 276 scoped_ptr<base::ListValue> list(new base::ListValue()); |
| 276 list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool", | 277 list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool", |
| 277 "transport_socket_pool", | 278 "transport_socket_pool", |
| 278 false)); | 279 false)); |
| 279 dict->Set("nested_pools", list.Pass()); | 280 dict->Set("nested_pools", list.Pass()); |
| 280 } | 281 } |
| 281 return dict; | 282 return dict.Pass(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { | 285 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { |
| 285 return base_.ConnectionTimeout(); | 286 return base_.ConnectionTimeout(); |
| 286 } | 287 } |
| 287 | 288 |
| 288 bool SOCKSClientSocketPool::IsStalled() const { | 289 bool SOCKSClientSocketPool::IsStalled() const { |
| 289 return base_.IsStalled(); | 290 return base_.IsStalled(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void SOCKSClientSocketPool::AddHigherLayeredPool( | 293 void SOCKSClientSocketPool::AddHigherLayeredPool( |
| 293 HigherLayeredPool* higher_pool) { | 294 HigherLayeredPool* higher_pool) { |
| 294 base_.AddHigherLayeredPool(higher_pool); | 295 base_.AddHigherLayeredPool(higher_pool); |
| 295 } | 296 } |
| 296 | 297 |
| 297 void SOCKSClientSocketPool::RemoveHigherLayeredPool( | 298 void SOCKSClientSocketPool::RemoveHigherLayeredPool( |
| 298 HigherLayeredPool* higher_pool) { | 299 HigherLayeredPool* higher_pool) { |
| 299 base_.RemoveHigherLayeredPool(higher_pool); | 300 base_.RemoveHigherLayeredPool(higher_pool); |
| 300 } | 301 } |
| 301 | 302 |
| 302 bool SOCKSClientSocketPool::CloseOneIdleConnection() { | 303 bool SOCKSClientSocketPool::CloseOneIdleConnection() { |
| 303 if (base_.CloseOneIdleSocket()) | 304 if (base_.CloseOneIdleSocket()) |
| 304 return true; | 305 return true; |
| 305 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 306 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
| 306 } | 307 } |
| 307 | 308 |
| 308 } // namespace net | 309 } // namespace net |
| OLD | NEW |