OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // See ClientSocketPool::GetInfoAsValue for documentation on this function. | 282 // See ClientSocketPool::GetInfoAsValue for documentation on this function. |
283 DictionaryValue* GetInfoAsValue(const std::string& name, | 283 DictionaryValue* GetInfoAsValue(const std::string& name, |
284 const std::string& type) const; | 284 const std::string& type) const; |
285 | 285 |
286 base::TimeDelta ConnectionTimeout() const { | 286 base::TimeDelta ConnectionTimeout() const { |
287 return connect_job_factory_->ConnectionTimeout(); | 287 return connect_job_factory_->ConnectionTimeout(); |
288 } | 288 } |
289 | 289 |
290 static bool connect_backup_jobs_enabled(); | 290 static bool connect_backup_jobs_enabled(); |
291 static bool set_connect_backup_jobs_enabled(bool enabled); | 291 static bool set_connect_backup_jobs_enabled(bool enabled); |
| 292 static double set_bytes_read_vs_last_accessed_alpha(double alpha); |
292 | 293 |
293 void EnableConnectBackupJobs(); | 294 void EnableConnectBackupJobs(); |
294 | 295 |
295 // ConnectJob::Delegate methods: | 296 // ConnectJob::Delegate methods: |
296 virtual void OnConnectJobComplete(int result, ConnectJob* job); | 297 virtual void OnConnectJobComplete(int result, ConnectJob* job); |
297 | 298 |
298 // NetworkChangeNotifier::IPAddressObserver methods: | 299 // NetworkChangeNotifier::IPAddressObserver methods: |
299 virtual void OnIPAddressChanged(); | 300 virtual void OnIPAddressChanged(); |
300 | 301 |
301 private: | 302 private: |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // Histograms for the pool | 747 // Histograms for the pool |
747 ClientSocketPoolHistograms* const histograms_; | 748 ClientSocketPoolHistograms* const histograms_; |
748 internal::ClientSocketPoolBaseHelper helper_; | 749 internal::ClientSocketPoolBaseHelper helper_; |
749 | 750 |
750 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); | 751 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); |
751 }; | 752 }; |
752 | 753 |
753 } // namespace net | 754 } // namespace net |
754 | 755 |
755 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 756 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
OLD | NEW |