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

Unified Diff: net/socket/client_socket_handle.h

Issue 11428150: LoadTiming implementation in net, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update comments Created 8 years 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
Index: net/socket/client_socket_handle.h
===================================================================
--- net/socket/client_socket_handle.h (revision 172981)
+++ net/socket/client_socket_handle.h (working copy)
@@ -19,10 +19,13 @@
#include "net/base/request_priority.h"
#include "net/http/http_response_info.h"
#include "net/socket/client_socket_pool.h"
+#include "net/socket/connect_timing.h"
#include "net/socket/stream_socket.h"
namespace net {
+struct LoadTimingInfo;
+
// A container for a StreamSocket.
//
// The handle's |group_name| uniquely identifies the origin and type of the
@@ -106,6 +109,14 @@
// Returns the time between Init() and when is_initialized() becomes true.
base::TimeDelta setup_time() const { return setup_time_; }
+ // Sets the portion of LoadTimingInfo related to connection establishment, and
+ // the socket id. |is_reused| is needed because the handle may not have full
+ // information. |load_timing_info| must have all default values when called.
+ // Returns false and makes no changes to |load_timing_info| when |socket_| is
+ // NULL.
+ bool GetLoadTimingInfo(bool is_reused,
+ LoadTimingInfo* load_timing_info) const;
+
// Used by ClientSocketPool to initialize the ClientSocketHandle.
void set_is_reused(bool is_reused) { is_reused_ = is_reused; }
void set_socket(StreamSocket* s) { socket_.reset(s); }
@@ -150,6 +161,10 @@
return UNUSED_IDLE;
}
}
+ const ConnectTiming& connect_timing() const { return connect_timing_; }
+ void set_connect_timing(const ConnectTiming& connect_timing) {
+ connect_timing_ = connect_timing;
+ }
private:
// Called on asynchronous completion of an Init() request.
@@ -185,6 +200,9 @@
NetLog::Source requesting_source_;
+ // Timing information is set when a connection is successfully established.
+ ConnectTiming connect_timing_;
+
DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle);
};

Powered by Google App Engine
This is Rietveld 408576698