Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: net/socket/client_socket_handle.h

Issue 3050040: Reland 54771 (and 54795) To enable TCP Preconnection by default... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/client_socket.cc ('k') | net/socket/client_socket_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « net/socket/client_socket.cc ('k') | net/socket/client_socket_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698