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

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

Issue 2511313002: transferSize implementation (Closed)
Patch Set: 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 4b73798487a884698755864ec7499d0944848da8..30cfb062a2f5a3ae03a314014d82cdad5a59cda6 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -309,12 +309,15 @@ void PerformanceBase::addResourceTiming(const ResourceTimingInfo& info) {
addResourceTimingBuffer(*entry);
}
-void PerformanceBase::addNavigationTiming(LocalFrame* frame) {
+void PerformanceBase::addNavigationTiming(
+ LocalFrame* frame,
+ ResourceTimingInfo* resourceTimingInfo) {
if (!RuntimeEnabledFeatures::performanceNavigationTiming2Enabled())
return;
DCHECK(frame);
const DocumentLoader* documentLoader = frame->loader().documentLoader();
DCHECK(documentLoader);
+
const DocumentLoadTiming& documentLoadTiming = documentLoader->timing();
const DocumentTiming* documentTiming =
@@ -331,7 +334,8 @@ void PerformanceBase::addNavigationTiming(LocalFrame* frame) {
double finishTime = documentLoadTiming.loadEventEnd();
// TODO(sunjian) Implement transfer size. crbug/663187
Yoav Weiss 2016/11/18 10:06:30 You can remove the TODO
sunjian 2016/11/18 20:23:29 Done.
- 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