OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // A ClientSocketPoolBase is used to restrict the number of sockets open at | 5 // A ClientSocketPoolBase is used to restrict the number of sockets open at |
6 // a time. It also maintains a list of idle persistent sockets for reuse. | 6 // a time. It also maintains a list of idle persistent sockets for reuse. |
7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle | 7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle |
8 // the core logic of (1) restricting the number of active (connected or | 8 // the core logic of (1) restricting the number of active (connected or |
9 // connecting) sockets per "group" (generally speaking, the hostname), (2) | 9 // connecting) sockets per "group" (generally speaking, the hostname), (2) |
10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3) | 10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3) |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 void CleanupIdleSockets(bool force); | 276 void CleanupIdleSockets(bool force); |
277 | 277 |
278 // See ClientSocketPool::GetInfoAsValue for documentation on this function. | 278 // See ClientSocketPool::GetInfoAsValue for documentation on this function. |
279 DictionaryValue* GetInfoAsValue(const std::string& name, | 279 DictionaryValue* GetInfoAsValue(const std::string& name, |
280 const std::string& type) const; | 280 const std::string& type) const; |
281 | 281 |
282 base::TimeDelta ConnectionTimeout() const { | 282 base::TimeDelta ConnectionTimeout() const { |
283 return connect_job_factory_->ConnectionTimeout(); | 283 return connect_job_factory_->ConnectionTimeout(); |
284 } | 284 } |
285 | 285 |
| 286 static bool connect_backup_jobs_enabled(); |
286 static void set_connect_backup_jobs_enabled(bool enabled); | 287 static void set_connect_backup_jobs_enabled(bool enabled); |
| 288 |
287 void EnableConnectBackupJobs(); | 289 void EnableConnectBackupJobs(); |
288 | 290 |
289 // ConnectJob::Delegate methods: | 291 // ConnectJob::Delegate methods: |
290 virtual void OnConnectJobComplete(int result, ConnectJob* job); | 292 virtual void OnConnectJobComplete(int result, ConnectJob* job); |
291 | 293 |
292 // NetworkChangeNotifier::IPAddressObserver methods: | 294 // NetworkChangeNotifier::IPAddressObserver methods: |
293 virtual void OnIPAddressChanged(); | 295 virtual void OnIPAddressChanged(); |
294 | 296 |
295 private: | 297 private: |
296 friend class base::RefCounted<ClientSocketPoolBaseHelper>; | 298 friend class base::RefCounted<ClientSocketPoolBaseHelper>; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 // Histograms for the pool | 739 // Histograms for the pool |
738 ClientSocketPoolHistograms* const histograms_; | 740 ClientSocketPoolHistograms* const histograms_; |
739 internal::ClientSocketPoolBaseHelper helper_; | 741 internal::ClientSocketPoolBaseHelper helper_; |
740 | 742 |
741 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); | 743 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); |
742 }; | 744 }; |
743 | 745 |
744 } // namespace net | 746 } // namespace net |
745 | 747 |
746 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 748 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
OLD | NEW |