| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 136 // All of the progress bar completion policies besides LoadEvent instead block |
| 137 // on parsing completion, which corresponds to finishing parsing. For those | 137 // on parsing completion, which corresponds to finishing parsing. For those |
| 138 // policies, don't consider resource load that start after DOMContentLoaded | 138 // policies, don't consider resource load that start after DOMContentLoaded |
| 139 // finishes. | 139 // finishes. |
| 140 if (m_frame->settings()->progressBarCompletion() != | 140 if (m_frame->settings()->progressBarCompletion() != |
| 141 ProgressBarCompletion::LoadEvent && | 141 ProgressBarCompletion::LoadEvent && |
| 142 (m_finishedParsing || priority < ResourceLoadPriorityHigh)) | 142 (m_finishedParsing || priority < ResourceLoadPriorityHigh)) |
| 143 return; | 143 return; |
| 144 DCHECK(!m_progressItems.get(identifier)); | |
| 145 m_progressItems.set( | 144 m_progressItems.set( |
| 146 identifier, | 145 identifier, |
| 147 wrapUnique(new ProgressItem(progressItemDefaultEstimatedLength))); | 146 wrapUnique(new ProgressItem(progressItemDefaultEstimatedLength))); |
| 148 } | 147 } |
| 149 | 148 |
| 150 void ProgressTracker::incrementProgress(unsigned long identifier, | 149 void ProgressTracker::incrementProgress(unsigned long identifier, |
| 151 const ResourceResponse& response) { | 150 const ResourceResponse& response) { |
| 152 ProgressItem* item = m_progressItems.get(identifier); | 151 ProgressItem* item = m_progressItems.get(identifier); |
| 153 if (!item) | 152 if (!item) |
| 154 return; | 153 return; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 void ProgressTracker::completeProgress(unsigned long identifier) { | 230 void ProgressTracker::completeProgress(unsigned long identifier) { |
| 232 ProgressItem* item = m_progressItems.get(identifier); | 231 ProgressItem* item = m_progressItems.get(identifier); |
| 233 if (!item) | 232 if (!item) |
| 234 return; | 233 return; |
| 235 | 234 |
| 236 item->estimatedLength = item->bytesReceived; | 235 item->estimatedLength = item->bytesReceived; |
| 237 maybeSendProgress(); | 236 maybeSendProgress(); |
| 238 } | 237 } |
| 239 | 238 |
| 240 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |