summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_pool_base.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-14 06:31:32 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-14 06:31:32 +0000
commitec581fc47811f98623f8293ee98cef6936b3aba8 (patch)
tree445bbea7731667f74e4a1f04eeb72ce0e5a53393 /net/socket/client_socket_pool_base.h
parent078fa60e19a8297e67db1c3ca8e727a867f57b57 (diff)
downloadchromium_src-ec581fc47811f98623f8293ee98cef6936b3aba8.zip
chromium_src-ec581fc47811f98623f8293ee98cef6936b3aba8.tar.gz
chromium_src-ec581fc47811f98623f8293ee98cef6936b3aba8.tar.bz2
Switch on socket late binding.
Histograms for the 4.0.266.0 dev channel release indicate the following changes for late binding: (a) Net.TCPSocketType shows a decrease (from 41.85% to 39.29%) in used of newly connected sockets. Part of this decrease is due to using previously used sockets more often (increase from 58.15% to 58.53%), but is primarily due to being able to use sockets that were connected, but not immediately handed over to a socket request (increased from 0 [not supported without late binding] to 2.18%). (b) Net.SocketIdleTimeBeforeNextUse_ReusedSocket indicates that reused sockets are getting used more quickly than before, with a decrease of mean idle time from 11.65 seconds to 11.34 seconds. (c) Net.Transaction_Connected_Under_10 indicates shows that the mean for time until the first byte of the transaction response decreased from 1585ms to 1481ms. The code change deletes the old non socket late binding code paths, cleaning up the code significantly. It also deletes duplicated tests in ClientSocketPoolBase which covered both pathways. A TCPClientSocketPool test had to be updated as well. BUG=http://crbug.com/30354. Review URL: http://codereview.chromium.org/543051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_base.h')
-rw-r--r--net/socket/client_socket_pool_base.h33
1 files changed, 2 insertions, 31 deletions
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index 8132065..c3440fc 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -65,7 +65,6 @@ class ConnectJob {
// A |timeout_duration| of 0 corresponds to no timeout.
ConnectJob(const std::string& group_name,
- const ClientSocketHandle* key_handle,
base::TimeDelta timeout_duration,
Delegate* delegate,
LoadLog* load_log);
@@ -73,7 +72,6 @@ class ConnectJob {
// Accessors
const std::string& group_name() const { return group_name_; }
- const ClientSocketHandle* key_handle() const { return key_handle_; }
LoadLog* load_log() { return load_log_; }
// Releases |socket_| to the client. On connection error, this should return
@@ -102,8 +100,6 @@ class ConnectJob {
void OnTimeout();
const std::string group_name_;
- // Temporarily needed until we switch to late binding.
- const ClientSocketHandle* const key_handle_;
const base::TimeDelta timeout_duration_;
// Timer to abort jobs that take too long.
base::OneShotTimer<ConnectJob> timer_;
@@ -209,14 +205,6 @@ class ClientSocketPoolBaseHelper
// NetworkChangeNotifier::Observer methods:
virtual void OnIPAddressChanged();
- // Enables late binding of sockets. In this mode, socket requests are
- // decoupled from socket connection jobs. A socket request may initiate a
- // socket connection job, but there is no guarantee that that socket
- // connection will service the request (for example, a released socket may
- // service the request sooner, or a higher priority request may come in
- // afterward and receive the socket from the job).
- static void EnableLateBindingOfSockets(bool enabled);
-
// For testing.
bool may_have_stalled_group() const { return may_have_stalled_group_; }
@@ -321,14 +309,8 @@ class ClientSocketPoolBaseHelper
CleanupIdleSockets(false);
}
- // Removes the ConnectJob corresponding to |handle| from the
- // |connect_job_map_| or |connect_job_set_| depending on whether or not late
- // binding is enabled. |job| must be non-NULL when late binding is
- // enabled. Also updates |group| if non-NULL. When late binding is disabled,
- // this will also delete the Request from |group->connecting_requests|.
- void RemoveConnectJob(const ClientSocketHandle* handle,
- const ConnectJob* job,
- Group* group);
+ // Removes |job| from |connect_job_set_|. Also updates |group| if non-NULL.
+ void RemoveConnectJob(const ConnectJob* job, Group* group);
// Same as OnAvailableSocketSlot except it looks up the Group first to see if
// it's there.
@@ -406,9 +388,6 @@ class ClientSocketPoolBaseHelper
const scoped_ptr<ConnectJobFactory> connect_job_factory_;
const scoped_refptr<NetworkChangeNotifier> network_change_notifier_;
-
- // Controls whether or not we use late binding of sockets.
- static bool g_late_binding;
};
} // namespace internal
@@ -578,14 +557,6 @@ class ClientSocketPoolBase {
DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase);
};
-// Enables late binding of sockets. In this mode, socket requests are
-// decoupled from socket connection jobs. A socket request may initiate a
-// socket connection job, but there is no guarantee that that socket
-// connection will service the request (for example, a released socket may
-// service the request sooner, or a higher priority request may come in
-// afterward and receive the socket from the job).
-void EnableLateBindingOfSockets(bool enabled);
-
} // namespace net
#endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_