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

Unified Diff: webkit/glue/resource_loader_bridge.h

Issue 7602023: Use a monotonic clock (TimeTicks) to report network times to WebCore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use strong typing Created 9 years, 1 month 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: webkit/glue/resource_loader_bridge.h
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h
index 6711039652ad869bb9584f6b524f2e50f963c0b1..db4257092cb90d0afe7f3200185732b3c65ff99b 100644
--- a/webkit/glue/resource_loader_bridge.h
+++ b/webkit/glue/resource_loader_bridge.h
@@ -33,6 +33,7 @@
#include "googleurl/src/gurl.h"
#include "net/base/host_port_pair.h"
#include "net/url_request/url_request_status.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoadTiming.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
#include "webkit/glue/resource_type.h"
@@ -52,8 +53,11 @@ struct ResourceLoadTimingInfo {
ResourceLoadTimingInfo();
~ResourceLoadTimingInfo();
- // All the values in this struct are given as offsets in milliseconds wrt
- // this base time.
+ // All the values in this struct are given as offsets in ticks wrt
+ // this base tick count.
+ base::TimeTicks base_ticks;
+
+ // The value of Time::Now() when base_ticks was set.
base::Time base_time;
// The time that proxy processing started. For requests with no proxy phase,
@@ -270,6 +274,12 @@ class ResourceLoaderBridge {
// The response data.
std::string data;
+
+ // TimeTicks when the network stack first receives the request.
+ base::TimeTicks net_start_time;
+
+ // TimeTicks when the response is sent to the renderer.
+ base::TimeTicks net_end_time;
};
// Generated by the bridge. This is implemented by our custom resource loader
@@ -296,12 +306,16 @@ class ResourceLoaderBridge {
// should be consulted for the third-party cookie blocking policy.
virtual bool OnReceivedRedirect(const GURL& new_url,
const ResourceResponseInfo& info,
+ const base::TimeTicks& start_time,
+ const base::TimeTicks& end_time,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies) = 0;
// Called when response headers are available (after all redirects have
// been followed).
- virtual void OnReceivedResponse(const ResourceResponseInfo& info) = 0;
+ virtual void OnReceivedResponse(const ResourceResponseInfo& info,
+ const base::TimeTicks& start_time,
+ const base::TimeTicks& end_time) = 0;
// Called when a chunk of response data is downloaded. This method may be
// called multiple times or not at all if an error occurs. This method is
@@ -324,9 +338,10 @@ class ResourceLoaderBridge {
// Called when the response is complete. This method signals completion of
// the resource load.ff
- virtual void OnCompletedRequest(const net::URLRequestStatus& status,
- const std::string& security_info,
- const base::Time& completion_time) = 0;
+ virtual void OnCompletedRequest(
+ const net::URLRequestStatus& status,
+ const std::string& security_info,
+ const base::TimeTicks& completion_time) = 0;
};
// use Create() for construction, but anybody can delete at any time,
@@ -401,6 +416,14 @@ class ResourceLoaderBridge {
DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge);
};
+// For testing purposes.
+WebKit::WebURLLoadTiming PopulateWebURLLoadTiming(
+ const ResourceLoadTimingInfo& timing_info,
+ const base::TimeTicks& initiation_time,
+ const base::TimeTicks& start_time,
+ const base::TimeTicks& end_time,
+ const base::TimeTicks& callback_time);
+
} // namespace webkit_glue
#endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698