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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceBase.cpp

Issue 2511313002: transferSize implementation (Closed)
Patch Set: added TODO Created 4 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: third_party/WebKit/Source/core/timing/PerformanceBase.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
index 6b4549c0f17b88f333c8f331616bcea357620c66..384be7cfe5a53373dc7065fbb1006eff0f6412c1 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -315,12 +315,15 @@ void PerformanceBase::addNavigationTiming(LocalFrame* frame) {
DCHECK(frame);
const DocumentLoader* documentLoader = frame->loader().documentLoader();
DCHECK(documentLoader);
+
const DocumentLoadTiming& documentLoadTiming = documentLoader->timing();
const DocumentTiming* documentTiming =
frame->document() ? &(frame->document()->timing()) : nullptr;
const ResourceResponse& finalResponse = documentLoader->response();
+ ResourceTimingInfo* resourceTimingInfo =
+ documentLoader->getMainResourceTimingInfo();
ResourceLoadTiming* resourceLoadTiming = finalResponse.resourceLoadTiming();
// Don't create a navigation timing instance when
@@ -331,8 +334,8 @@ void PerformanceBase::addNavigationTiming(LocalFrame* frame) {
double lastRedirectEndTime = documentLoadTiming.redirectEnd();
double finishTime = documentLoadTiming.loadEventEnd();
- // TODO(sunjian) Implement transfer size. crbug/663187
- unsigned long long transferSize = 0;
+ unsigned long long transferSize =
+ resourceTimingInfo ? resourceTimingInfo->transferSize() : 0;
unsigned long long encodedBodyLength = finalResponse.encodedBodyLength();
unsigned long long decodedBodyLength = finalResponse.decodedBodyLength();
bool didReuseConnection = finalResponse.connectionReused();

Powered by Google App Engine
This is Rietveld 408576698