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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 2582863002: fixed encodedBodySize/decodedBodySize/name/initiatorType for nav timing 2 (Closed)
Patch Set: fixed encodedBodySize/decodedBodySize/initiatorType for nav timing 2 Created 4 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: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 516325610dddc8c5c7192fc3900ccba6e0c11f40..9934d698a4a8f29ae7b6661bbd03b9e951c25f6b 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -196,7 +196,7 @@ ResourceLoadPriority ResourceFetcher::computeLoadPriority(
request.resourceRequest().priority());
}
-static void populateResourceTiming(ResourceTimingInfo* info,
+static void populateTimingInfo(ResourceTimingInfo* info,
Resource* resource) {
KURL initialURL = resource->response().redirectResponses().isEmpty()
? resource->resourceRequest().url()
@@ -308,7 +308,7 @@ void ResourceFetcher::requestLoadStarted(unsigned long identifier,
std::unique_ptr<ResourceTimingInfo> info = ResourceTimingInfo::create(
request.options().initiatorInfo.name, monotonicallyIncreasingTime(),
resource->getType() == Resource::MainResource);
- populateResourceTiming(info.get(), resource);
+ populateTimingInfo(info.get(), resource);
info->clearLoadTimings();
info->setLoadFinishTime(info->initialTime());
m_scheduledResourceTimingReports.append(std::move(info));
@@ -1144,6 +1144,7 @@ void ResourceFetcher::handleLoaderFinish(Resource* resource,
// Store redirect responses that were packed inside the final response.
addRedirectsToTimingInfo(resource, m_navigationTimingInfo.get());
if (resource->response().isHTTP()) {
+ populateTimingInfo(m_navigationTimingInfo.get(), resource);
m_navigationTimingInfo->addFinalTransferSize(
encodedDataLength == -1 ? 0 : encodedDataLength);
}
@@ -1155,7 +1156,7 @@ void ResourceFetcher::handleLoaderFinish(Resource* resource,
if (resource->response().isHTTP() &&
resource->response().httpStatusCode() < 400) {
- populateResourceTiming(info.get(), resource);
+ populateTimingInfo(info.get(), resource);
info->setLoadFinishTime(finishTime);
// encodedDataLength == -1 means "not available".
// TODO(ricea): Find cases where it is not available but the

Powered by Google App Engine
This is Rietveld 408576698