OLD | NEW |
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 if (m_progressValue == 1) | 126 if (m_progressValue == 1) |
127 return; | 127 return; |
128 m_progressValue = 1; | 128 m_progressValue = 1; |
129 m_frame->loader().client()->progressEstimateChanged(m_progressValue); | 129 m_frame->loader().client()->progressEstimateChanged(m_progressValue); |
130 } | 130 } |
131 | 131 |
132 void ProgressTracker::willStartLoading(unsigned long identifier, | 132 void ProgressTracker::willStartLoading(unsigned long identifier, |
133 ResourceLoadPriority priority) { | 133 ResourceLoadPriority priority) { |
134 if (!m_frame->isLoading()) | 134 if (!m_frame->isLoading()) |
135 return; | 135 return; |
136 // All of the progress bar completion policies besides LoadEvent instead block
on parsing | 136 // All of the progress bar completion policies besides LoadEvent instead block |
137 // completion, which corresponds to finishing parsing. For those policies, don
't consider | 137 // on parsing completion, which corresponds to finishing parsing. For those |
138 // resource load that start after DOMContentLoaded finishes. | 138 // policies, don't consider resource load that start after DOMContentLoaded |
| 139 // finishes. |
139 if (m_frame->settings()->progressBarCompletion() != | 140 if (m_frame->settings()->progressBarCompletion() != |
140 ProgressBarCompletion::LoadEvent && | 141 ProgressBarCompletion::LoadEvent && |
141 (m_finishedParsing || priority < ResourceLoadPriorityHigh)) | 142 (m_finishedParsing || priority < ResourceLoadPriorityHigh)) |
142 return; | 143 return; |
143 DCHECK(!m_progressItems.get(identifier)); | 144 DCHECK(!m_progressItems.get(identifier)); |
144 m_progressItems.set( | 145 m_progressItems.set( |
145 identifier, | 146 identifier, |
146 wrapUnique(new ProgressItem(progressItemDefaultEstimatedLength))); | 147 wrapUnique(new ProgressItem(progressItemDefaultEstimatedLength))); |
147 } | 148 } |
148 | 149 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void ProgressTracker::completeProgress(unsigned long identifier) { | 228 void ProgressTracker::completeProgress(unsigned long identifier) { |
228 ProgressItem* item = m_progressItems.get(identifier); | 229 ProgressItem* item = m_progressItems.get(identifier); |
229 if (!item) | 230 if (!item) |
230 return; | 231 return; |
231 | 232 |
232 item->estimatedLength = item->bytesReceived; | 233 item->estimatedLength = item->bytesReceived; |
233 maybeSendProgress(); | 234 maybeSendProgress(); |
234 } | 235 } |
235 | 236 |
236 } // namespace blink | 237 } // namespace blink |
OLD | NEW |