Index: net/socket/client_socket_handle.h |
=================================================================== |
--- net/socket/client_socket_handle.h (revision 55108) |
+++ net/socket/client_socket_handle.h (working copy) |
@@ -132,7 +132,10 @@ |
const std::string& group_name() const { return group_name_; } |
int id() const { return pool_id_; } |
ClientSocket* socket() { return socket_.get(); } |
- ClientSocket* release_socket() { return socket_.release(); } |
+ ClientSocket* release_socket() { |
+ UpdateConnectivityStateForSocket(); |
+ return socket_.release(); |
+ } |
bool is_reused() const { return is_reused_; } |
base::TimeDelta idle_time() const { return idle_time_; } |
SocketReuseType reuse_type() const { |
@@ -174,6 +177,15 @@ |
// Resets the supplemental error state. |
void ResetErrorState(); |
+ // Update the base class to record things like whether we've ever transmitted |
+ // data, and whether the connection was able to be established. We use this |
+ // data to construct histograms indicating whether a speculative connection |
+ // was ever used, etc., when the ClientSocket is eventually discarded. |
+ void UpdateConnectivityStateForSocket() const { |
+ if (socket_.get()) |
+ socket_->UpdateConnectivityState(is_reused()); |
+ } |
+ |
bool is_initialized_; |
scoped_refptr<ClientSocketPool> pool_; |
scoped_ptr<ClientSocket> socket_; |