OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/network/ResourceTimingInfo.h" | 5 #include "platform/network/ResourceTimingInfo.h" |
6 | 6 |
7 #include "platform/CrossThreadCopier.h" | 7 #include "platform/CrossThreadCopier.h" |
8 #include "wtf/PtrUtil.h" | 8 #include "wtf/PtrUtil.h" |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 data->m_loadFinishTime = m_loadFinishTime; | 32 data->m_loadFinishTime = m_loadFinishTime; |
33 data->m_initialRequest = m_initialRequest.copyData(); | 33 data->m_initialRequest = m_initialRequest.copyData(); |
34 data->m_finalResponse = m_finalResponse.copyData(); | 34 data->m_finalResponse = m_finalResponse.copyData(); |
35 for (const auto& response : m_redirectChain) | 35 for (const auto& response : m_redirectChain) |
36 data->m_redirectChain.append(response.copyData()); | 36 data->m_redirectChain.append(response.copyData()); |
37 data->m_transferSize = m_transferSize; | 37 data->m_transferSize = m_transferSize; |
38 data->m_isMainResource = m_isMainResource; | 38 data->m_isMainResource = m_isMainResource; |
39 return data; | 39 return data; |
40 } | 40 } |
41 | 41 |
42 void ResourceTimingInfo::addRedirect(const ResourceResponse& redirectResponse, l
ong long encodedDataLength, bool crossOrigin) | 42 void ResourceTimingInfo::addRedirect(const ResourceResponse& redirectResponse, b
ool crossOrigin) |
43 { | 43 { |
44 m_redirectChain.append(redirectResponse); | 44 m_redirectChain.append(redirectResponse); |
45 if (m_hasCrossOriginRedirect) | 45 if (m_hasCrossOriginRedirect) |
46 return; | 46 return; |
47 if (crossOrigin) { | 47 if (crossOrigin) { |
48 m_hasCrossOriginRedirect = true; | 48 m_hasCrossOriginRedirect = true; |
49 m_transferSize = 0; | 49 m_transferSize = 0; |
50 } else { | 50 } else { |
51 DCHECK_GE(encodedDataLength, 0); | 51 DCHECK_GE(redirectResponse.encodedDataLength(), 0); |
52 m_transferSize += encodedDataLength; | 52 m_transferSize += redirectResponse.encodedDataLength(); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
OLD | NEW |