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

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

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Fix lint error: ASSERT -> DCHECK Created 4 years, 6 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: third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp
index 18ccf424ef7002fa658a99dd43f4385466a11416..8f131d87db65578bf977ab51933973f6f91c6977 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp
@@ -55,6 +55,9 @@ PerformanceResourceTiming::PerformanceResourceTiming(const ResourceTimingInfo& i
, m_timing(info.finalResponse().resourceLoadTiming())
, m_lastRedirectEndTime(lastRedirectEndTime)
, m_finishTime(info.loadFinishTime())
+ , m_transferSize(info.transferSize())
+ , m_encodedBodySize(info.finalResponse().encodedBodyLength())
+ , m_decodedBodySize(info.finalResponse().decodedBodyLength())
, m_didReuseConnection(info.finalResponse().connectionReused())
, m_allowTimingDetails(allowTimingDetails)
, m_allowRedirectDetails(allowRedirectDetails)
@@ -213,6 +216,30 @@ double PerformanceResourceTiming::responseEnd() const
return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, m_finishTime);
}
+unsigned long long PerformanceResourceTiming::transferSize() const
+{
+ if (!m_allowTimingDetails)
+ return 0;
+
+ return m_transferSize;
+}
+
+unsigned long long PerformanceResourceTiming::encodedBodySize() const
+{
+ if (!m_allowTimingDetails)
+ return 0;
+
+ return m_encodedBodySize;
+}
+
+unsigned long long PerformanceResourceTiming::decodedBodySize() const
+{
+ if (!m_allowTimingDetails)
+ return 0;
+
+ return m_decodedBodySize;
+}
+
void PerformanceResourceTiming::buildJSONValue(V8ObjectBuilder& builder) const
{
PerformanceEntry::buildJSONValue(builder);
@@ -229,6 +256,9 @@ void PerformanceResourceTiming::buildJSONValue(V8ObjectBuilder& builder) const
builder.addNumber("requestStart", requestStart());
builder.addNumber("responseStart", responseStart());
builder.addNumber("responseEnd", responseEnd());
+ builder.addNumber("transferSize", transferSize());
+ builder.addNumber("encodedBodySize", encodedBodySize());
+ builder.addNumber("decodedBodySize", decodedBodySize());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698