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

Side by Side 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, 5 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 15 matching lines...) Expand all
26 { 26 {
27 std::unique_ptr<CrossThreadResourceTimingInfoData> data = wrapUnique(new Cro ssThreadResourceTimingInfoData); 27 std::unique_ptr<CrossThreadResourceTimingInfoData> data = wrapUnique(new Cro ssThreadResourceTimingInfoData);
28 data->m_type = m_type.getString().isolatedCopy(); 28 data->m_type = m_type.getString().isolatedCopy();
29 data->m_originalTimingAllowOrigin = m_originalTimingAllowOrigin.getString(). isolatedCopy(); 29 data->m_originalTimingAllowOrigin = m_originalTimingAllowOrigin.getString(). isolatedCopy();
30 data->m_initialTime = m_initialTime; 30 data->m_initialTime = m_initialTime;
31 data->m_loadFinishTime = m_loadFinishTime; 31 data->m_loadFinishTime = m_loadFinishTime;
32 data->m_initialRequest = m_initialRequest.copyData(); 32 data->m_initialRequest = m_initialRequest.copyData();
33 data->m_finalResponse = m_finalResponse.copyData(); 33 data->m_finalResponse = m_finalResponse.copyData();
34 for (const auto& response : m_redirectChain) 34 for (const auto& response : m_redirectChain)
35 data->m_redirectChain.append(response.copyData()); 35 data->m_redirectChain.append(response.copyData());
36 data->m_transferSize = m_transferSize;
36 data->m_isMainResource = m_isMainResource; 37 data->m_isMainResource = m_isMainResource;
37 return data; 38 return data;
38 } 39 }
39 40
41 void ResourceTimingInfo::addRedirect(const ResourceResponse& redirectResponse, l ong long encodedDataLength, bool crossOrigin)
42 {
43 m_redirectChain.append(redirectResponse);
44 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.
45 m_hasCrossOriginRedirect = true;
46 m_transferSize = 0;
47 } else if (!m_hasCrossOriginRedirect) {
48 DCHECK_GE(encodedDataLength, 0);
49 m_transferSize += encodedDataLength;
50 }
51 }
52
40 } // namespace blink 53 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698