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

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

Issue 2340603002: For more aggressive progress bar completion strategies, only count high priority resources (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/loader/ProgressTracker.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 void ProgressTracker::sendFinalProgress() 137 void ProgressTracker::sendFinalProgress()
138 { 138 {
139 if (m_progressValue == 1) 139 if (m_progressValue == 1)
140 return; 140 return;
141 m_progressValue = 1; 141 m_progressValue = 1;
142 m_frame->loader().client()->progressEstimateChanged(m_progressValue); 142 m_frame->loader().client()->progressEstimateChanged(m_progressValue);
143 } 143 }
144 144
145 void ProgressTracker::willStartLoading(unsigned long identifier) 145 void ProgressTracker::willStartLoading(unsigned long identifier, ResourceLoadPri ority priority)
146 { 146 {
147 if (!m_frame->isLoading()) 147 if (!m_frame->isLoading())
148 return; 148 return;
149 // All of the progress bar completion policies besides LoadEvent instead blo ck on parsing 149 // All of the progress bar completion policies besides LoadEvent instead blo ck on parsing
150 // completion, which corresponds to finishing parsing. For those policies, d on't consider 150 // completion, which corresponds to finishing parsing. For those policies, d on't consider
151 // resource load that start after DOMContentLoaded finishes. 151 // resource load that start after DOMContentLoaded finishes.
152 if (m_frame->settings()->progressBarCompletion() != ProgressBarCompletion::L oadEvent && m_finishedParsing) 152 if (m_frame->settings()->progressBarCompletion() != ProgressBarCompletion::L oadEvent && (m_finishedParsing || priority < ResourceLoadPriorityHigh))
153 return; 153 return;
154 DCHECK(!m_progressItems.get(identifier)); 154 DCHECK(!m_progressItems.get(identifier));
155 m_progressItems.set(identifier, wrapUnique(new ProgressItem(progressItemDefa ultEstimatedLength))); 155 m_progressItems.set(identifier, wrapUnique(new ProgressItem(progressItemDefa ultEstimatedLength)));
156 } 156 }
157 157
158 void ProgressTracker::incrementProgress(unsigned long identifier, const Resource Response& response) 158 void ProgressTracker::incrementProgress(unsigned long identifier, const Resource Response& response)
159 { 159 {
160 ProgressItem* item = m_progressItems.get(identifier); 160 ProgressItem* item = m_progressItems.get(identifier);
161 if (!item) 161 if (!item)
162 return; 162 return;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 { 231 {
232 ProgressItem* item = m_progressItems.get(identifier); 232 ProgressItem* item = m_progressItems.get(identifier);
233 if (!item) 233 if (!item)
234 return; 234 return;
235 235
236 item->estimatedLength = item->bytesReceived; 236 item->estimatedLength = item->bytesReceived;
237 maybeSendProgress(); 237 maybeSendProgress();
238 } 238 }
239 239
240 } // namespace blink 240 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/ProgressTracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698