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

Unified Diff: content/common/resource_dispatcher.cc

Issue 14359004: Inject renderer recieve message time into resource notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added description comment Created 7 years, 8 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
Index: content/common/resource_dispatcher.cc
diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc
index 73f3ca649fc5f455ff70938c9704dcce71b23090..9fcd328aeb267c32f392c2437c409968a7c68a61 100644
--- a/content/common/resource_dispatcher.cc
+++ b/content/common/resource_dispatcher.cc
@@ -257,7 +257,8 @@ void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) {
ResourceDispatcher::ResourceDispatcher(IPC::Sender* sender)
: message_sender_(sender),
weak_factory_(this),
- delegate_(NULL) {
+ delegate_(NULL),
+ io_timestamp_(base::TimeTicks()) {
}
ResourceDispatcher::~ResourceDispatcher() {
@@ -334,7 +335,8 @@ void ResourceDispatcher::OnReceivedResponse(
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info)
return;
- request_info->response_start = base::TimeTicks::Now();
+ request_info->response_start = io_timestamp_;
+ io_timestamp_ = base::TimeTicks();
if (delegate_) {
ResourceLoaderBridge::Peer* new_peer =
@@ -447,7 +449,8 @@ void ResourceDispatcher::OnReceivedRedirect(
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info)
return;
- request_info->response_start = base::TimeTicks::Now();
+ request_info->response_start = io_timestamp_;
+ io_timestamp_ = base::TimeTicks();
int32 routing_id = message.routing_id();
bool has_new_first_party_for_cookies = false;
@@ -491,7 +494,8 @@ void ResourceDispatcher::OnRequestComplete(
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info)
return;
- request_info->completion_time = base::TimeTicks::Now();
+ request_info->completion_time = io_timestamp_;
+ io_timestamp_ = base::TimeTicks();
request_info->buffer.reset();
request_info->buffer_size = 0;

Powered by Google App Engine
This is Rietveld 408576698