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

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

Issue 2511313002: transferSize implementation (Closed)
Patch Set: addressed comments 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 39a7e3029048b737b9dd46be61be55e16c9c23ef..f4f2607af01ce25251ea6010c011eae78acd4232 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -336,12 +336,17 @@ 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* navigationTimingInfo =
+ documentLoader->getNavigationTimingInfo();
+ if (!navigationTimingInfo)
+ return;
ResourceLoadTiming* resourceLoadTiming = finalResponse.resourceLoadTiming();
// Don't create a navigation timing instance when
@@ -352,8 +357,7 @@ 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 = navigationTimingInfo->transferSize();
unsigned long long encodedBodyLength = finalResponse.encodedBodyLength();
unsigned long long decodedBodyLength = finalResponse.decodedBodyLength();
bool didReuseConnection = finalResponse.connectionReused();
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698