diff options
author | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-16 01:15:57 +0000 |
---|---|---|
committer | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-16 01:15:57 +0000 |
commit | cb8a8742120db88ae594cc84cb2a046a7fa2cac4 (patch) | |
tree | 0b7e59029a00bea062a19b72c152db3e585a9b54 /content/common/resource_dispatcher.h | |
parent | 4c4fa0299be73c03988278d486dd4d19bd14167e (diff) | |
download | chromium_src-cb8a8742120db88ae594cc84cb2a046a7fa2cac4.zip chromium_src-cb8a8742120db88ae594cc84cb2a046a7fa2cac4.tar.gz chromium_src-cb8a8742120db88ae594cc84cb2a046a7fa2cac4.tar.bz2 |
Use a monotonic clock (TimeTicks) to report network times to WebCore.
Navigation Timing (window.performance.timing) is now spec'd to use monotonically increasing time, so we need to follow suit. Most of this CL is just plumbing TimeTicks through. We already use TimeTicks to implement monotonicallyIncreasingTime() in WebCore.
On Windows, the clock doesn't tick uniformly between processes, so there is a layer in content that corrects for skew.
BUG=None
TEST=Adhoc (ran webtiming-* LayoutTests from Chrome) and content_unittests
Review URL: http://codereview.chromium.org/7602023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/resource_dispatcher.h')
-rw-r--r-- | content/common/resource_dispatcher.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/content/common/resource_dispatcher.h b/content/common/resource_dispatcher.h index 1b8e3a3..7c5cdba 100644 --- a/content/common/resource_dispatcher.h +++ b/content/common/resource_dispatcher.h @@ -15,6 +15,7 @@ #include "base/memory/linked_ptr.h" #include "base/memory/weak_ptr.h" #include "base/shared_memory.h" +#include "base/time.h" #include "content/common/content_export.h" #include "ipc/ipc_channel.h" #include "webkit/glue/resource_loader_bridge.h" @@ -79,7 +80,8 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Channel::Listener { : peer(peer), resource_type(resource_type), is_deferred(false), - url(request_url) { + url(request_url), + request_start(base::TimeTicks::Now()) { } ~PendingRequestInfo() { } webkit_glue::ResourceLoaderBridge::Peer* peer; @@ -88,6 +90,9 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Channel::Listener { bool is_deferred; GURL url; linked_ptr<IPC::Message> pending_redirect_message; + base::TimeTicks request_start; + base::TimeTicks response_start; + base::TimeTicks completion_time; }; typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; @@ -110,7 +115,7 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Channel::Listener { const IPC::Message& message, int request_id, const GURL& new_url, - const webkit_glue::ResourceResponseInfo& info); + const content::ResourceResponseHead& response_head); void OnReceivedData( const IPC::Message& message, int request_id, @@ -125,7 +130,7 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Channel::Listener { int request_id, const net::URLRequestStatus& status, const std::string& security_info, - const base::Time& completion_time); + const base::TimeTicks& completion_time); // Dispatch the message to one of the message response handlers. void DispatchMessage(const IPC::Message& message); @@ -134,6 +139,15 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Channel::Listener { // again in the deferred state. void FlushDeferredMessages(int request_id); + void ToResourceResponseInfo( + const PendingRequestInfo& request_info, + const content::ResourceResponseHead& browser_info, + webkit_glue::ResourceResponseInfo* renderer_info) const; + + base::TimeTicks ToRendererCompletionTime( + const PendingRequestInfo& request_info, + const base::TimeTicks& browser_completion_time) const; + // Returns true if the message passed in is a resource related message. static bool IsResourceDispatcherMessage(const IPC::Message& message); |