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

Side by Side Diff: third_party/WebKit/Source/core/loader/ProgressTracker.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (!m_frame->isLoading()) 138 if (!m_frame->isLoading())
139 return; 139 return;
140 // All of the progress bar completion policies besides LoadEvent instead block 140 // All of the progress bar completion policies besides LoadEvent instead block
141 // on parsing completion, which corresponds to finishing parsing. For those 141 // on parsing completion, which corresponds to finishing parsing. For those
142 // policies, don't consider resource load that start after DOMContentLoaded 142 // policies, don't consider resource load that start after DOMContentLoaded
143 // finishes. 143 // finishes.
144 if (m_frame->settings()->getProgressBarCompletion() != 144 if (m_frame->settings()->getProgressBarCompletion() !=
145 ProgressBarCompletion::LoadEvent && 145 ProgressBarCompletion::LoadEvent &&
146 (m_finishedParsing || priority < ResourceLoadPriorityHigh)) 146 (m_finishedParsing || priority < ResourceLoadPriorityHigh))
147 return; 147 return;
148 m_progressItems.set(identifier, WTF::makeUnique<ProgressItem>( 148 m_progressItems.set(
149 progressItemDefaultEstimatedLength)); 149 identifier,
150 WTF::makeUnique<ProgressItem>(progressItemDefaultEstimatedLength));
150 } 151 }
151 152
152 void ProgressTracker::incrementProgress(unsigned long identifier, 153 void ProgressTracker::incrementProgress(unsigned long identifier,
153 const ResourceResponse& response) { 154 const ResourceResponse& response) {
154 ProgressItem* item = m_progressItems.get(identifier); 155 ProgressItem* item = m_progressItems.get(identifier);
155 if (!item) 156 if (!item)
156 return; 157 return;
157 158
158 long long estimatedLength = response.expectedContentLength(); 159 long long estimatedLength = response.expectedContentLength();
159 if (estimatedLength < 0) 160 if (estimatedLength < 0)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 void ProgressTracker::completeProgress(unsigned long identifier) { 234 void ProgressTracker::completeProgress(unsigned long identifier) {
234 ProgressItem* item = m_progressItems.get(identifier); 235 ProgressItem* item = m_progressItems.get(identifier);
235 if (!item) 236 if (!item)
236 return; 237 return;
237 238
238 item->estimatedLength = item->bytesReceived; 239 item->estimatedLength = item->bytesReceived;
239 maybeSendProgress(); 240 maybeSendProgress();
240 } 241 }
241 242
242 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698