Chromium Code Reviews| 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 |