Index: webkit/glue/resource_loader_bridge.h |
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h |
index da0a36e716607c916ea6eca00268c9e974c4560a..8bf3856e56351f34b66f77625843cad9b24ad6e0 100644 |
--- a/webkit/glue/resource_loader_bridge.h |
+++ b/webkit/glue/resource_loader_bridge.h |
@@ -32,6 +32,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" |
@@ -51,8 +52,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& net_start_time, |
darin (slow to review)
2011/12/06 01:06:32
are you sure you wouldn't want to include these ti
James Simonsen
2011/12/10 00:21:47
Done.
|
+ const base::TimeTicks& net_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& net_start_time, |
+ const base::TimeTicks& net_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 WebKitPlatformSupportImpl::CreateResourceLoader() for construction, but |
@@ -398,6 +413,14 @@ class ResourceLoaderBridge { |
DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
}; |
+// For testing purposes. |
+WebKit::WebURLLoadTiming PopulateWebURLLoadTiming( |
+ const ResourceLoadTimingInfo& timing_info, |
+ const base::TimeTicks& ipc_request_time, |
+ const base::TimeTicks& net_start_time, |
+ const base::TimeTicks& net_end_time, |
+ const base::TimeTicks& ipc_response_time); |
+ |
} // namespace webkit_glue |
#endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |