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

Unified Diff: third_party/WebKit/Source/platform/network/ResourceTimingInfo.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/platform/network/ResourceTimingInfo.cpp
diff --git a/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp b/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp
index 064cc455f53795a771dfdc95e4f23990251388f5..1c31e48773fb085ffb781390caa94a8ae7d18c57 100644
--- a/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp
@@ -33,8 +33,21 @@ std::unique_ptr<CrossThreadResourceTimingInfoData> ResourceTimingInfo::copyData(
data->m_finalResponse = m_finalResponse.copyData();
for (const auto& response : m_redirectChain)
data->m_redirectChain.append(response.copyData());
+ data->m_transferSize = m_transferSize;
data->m_isMainResource = m_isMainResource;
return data;
}
+void ResourceTimingInfo::addRedirect(const ResourceResponse& redirectResponse, long long encodedDataLength, bool crossOrigin)
+{
+ m_redirectChain.append(redirectResponse);
+ if (crossOrigin && !m_hasCrossOriginRedirect) {
Kunihiko Sakamoto 2016/07/01 10:12:35 Early return if m_hasCrossOriginRedirect is true?
Adam Rice 2016/07/04 02:44:18 Done, thanks.
+ m_hasCrossOriginRedirect = true;
+ m_transferSize = 0;
+ } else if (!m_hasCrossOriginRedirect) {
+ DCHECK_GE(encodedDataLength, 0);
+ m_transferSize += encodedDataLength;
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698