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

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceTimingInfo.cpp

Issue 2316573002: PlzNavigate: Support ResourceTiming API (Closed)
Patch Set: Move redirect response inside the final response. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698