A/B experiment for re-establishing TCP connections.
We would like to test the impact of automatic retries when a TCP connection exceeds a certain threshold before it gets back an ACK. We are observing a fair number of sockets where the connection had been established, but the sockets
were not used thereafter.
r=mbelche
Review URL: http://codereview.chromium.org/3191019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57276 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 96c78d59c..ee727f0 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -239,7 +239,8 @@
return connect_job_factory_->ConnectionTimeout();
}
- void EnableBackupJobs() { backup_jobs_enabled_ = true; }
+ static void set_connect_backup_jobs_enabled(bool enabled);
+ void EnableConnectBackupJobs();
private:
friend class base::RefCounted<ClientSocketPoolBaseHelper>;
@@ -271,7 +272,7 @@
struct Group {
Group()
: active_socket_count(0),
- backup_job(NULL),
+ connect_backup_job(NULL),
backup_task(NULL) {
}
@@ -299,9 +300,9 @@
}
void CleanupBackupJob() {
- if (backup_job) {
- delete backup_job;
- backup_job = NULL;
+ if (connect_backup_job) {
+ delete connect_backup_job;
+ connect_backup_job = NULL;
}
if (backup_task) {
backup_task->Cancel();
@@ -314,7 +315,7 @@
RequestQueue pending_requests;
int active_socket_count; // number of active sockets used by clients
// A backup job in case the connect for this group takes too long.
- ConnectJob* backup_job;
+ ConnectJob* connect_backup_job;
CancelableTask* backup_task;
};
@@ -461,7 +462,7 @@
const scoped_ptr<ConnectJobFactory> connect_job_factory_;
// TODO(vandebo) Remove when backup jobs move to TCPClientSocketPool
- bool backup_jobs_enabled_;
+ bool connect_backup_jobs_enabled_;
// A factory to pin the backup_job tasks.
ScopedRunnableMethodFactory<ClientSocketPoolBaseHelper> method_factory_;
@@ -595,7 +596,7 @@
return histograms_;
}
- void EnableBackupJobs() { helper_->EnableBackupJobs(); }
+ void EnableConnectBackupJobs() { helper_->EnableConnectBackupJobs(); }
void Flush() { helper_->Flush(); }