Chromium Code Reviews| Index: net/socket/client_socket_pool_base.h |
| =================================================================== |
| --- net/socket/client_socket_pool_base.h (revision 88319) |
| +++ net/socket/client_socket_pool_base.h (working copy) |
| @@ -167,6 +167,12 @@ |
| NO_IDLE_SOCKETS = 0x1, // Do not return an idle socket. Create a new one. |
| }; |
| + enum ClientSocketReusePolicy { |
| + USE_WARMEST_SOCKET = 0, |
| + USE_WARM_SOCKET = 1, |
| + USE_LAST_ACCESSED_SOCKET = 2, |
| + }; |
| + |
| class NET_TEST Request { |
| public: |
| Request(ClientSocketHandle* handle, |
| @@ -290,6 +296,10 @@ |
| static bool connect_backup_jobs_enabled(); |
| static bool set_connect_backup_jobs_enabled(bool enabled); |
| + // Sets the client socket reuse policy (using warmest socket vs. last accessed |
| + // socket). |
| + static double SetSocketReusePolicy(int policy); |
|
Mike Belshe
2011/06/12 22:10:35
Instead of an int, you could use a ClientSocketReu
Gagan
2011/06/13 03:52:47
was doing that initially, but ran into problems in
|
| + |
| void EnableConnectBackupJobs(); |
| // ConnectJob::Delegate methods: |
| @@ -743,6 +753,8 @@ |
| const scoped_ptr<ConnectJobFactory> connect_job_factory_; |
| }; |
| + void ApplySocketReuseGroup(int warmest_socket_trial_group, |
| + const int* socket_policy); |
| // Histograms for the pool |
| ClientSocketPoolHistograms* const histograms_; |
| internal::ClientSocketPoolBaseHelper helper_; |