| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 m_progressValue = 0; | 97 m_progressValue = 0; |
| 98 m_lastNotifiedProgressValue = 0; | 98 m_lastNotifiedProgressValue = 0; |
| 99 m_lastNotifiedProgressTime = 0; | 99 m_lastNotifiedProgressTime = 0; |
| 100 m_finalProgressChangedSent = false; | 100 m_finalProgressChangedSent = false; |
| 101 m_numProgressTrackedFrames = 0; | 101 m_numProgressTrackedFrames = 0; |
| 102 m_originatingProgressFrame = 0; | 102 m_originatingProgressFrame = 0; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ProgressTracker::progressStarted(Frame* frame) | 105 void ProgressTracker::progressStarted(Frame* frame) |
| 106 { | 106 { |
| 107 WTF_LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, track
ed frames %d, originating frame %p", this, frame, frame->tree().uniqueName().str
ing().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingP
rogressFrame.get()); | 107 WTF_LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, track
ed frames %d, originating frame %p", this, frame, frame->tree().uniqueName().utf
8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFr
ame.get()); |
| 108 | 108 |
| 109 if (m_numProgressTrackedFrames == 0 || m_originatingProgressFrame == frame)
{ | 109 if (m_numProgressTrackedFrames == 0 || m_originatingProgressFrame == frame)
{ |
| 110 reset(); | 110 reset(); |
| 111 m_progressValue = initialProgressValue; | 111 m_progressValue = initialProgressValue; |
| 112 m_originatingProgressFrame = frame; | 112 m_originatingProgressFrame = frame; |
| 113 | 113 |
| 114 m_originatingProgressFrame->loader().client()->postProgressStartedNotifi
cation(); | 114 m_originatingProgressFrame->loader().client()->postProgressStartedNotifi
cation(); |
| 115 } | 115 } |
| 116 m_numProgressTrackedFrames++; | 116 m_numProgressTrackedFrames++; |
| 117 InspectorInstrumentation::frameStartedLoading(frame); | 117 InspectorInstrumentation::frameStartedLoading(frame); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void ProgressTracker::progressCompleted(Frame* frame) | 120 void ProgressTracker::progressCompleted(Frame* frame) |
| 121 { | 121 { |
| 122 WTF_LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tra
cked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().s
tring().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatin
gProgressFrame.get()); | 122 WTF_LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tra
cked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().u
tf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgress
Frame.get()); |
| 123 | 123 |
| 124 if (m_numProgressTrackedFrames <= 0) | 124 if (m_numProgressTrackedFrames <= 0) |
| 125 return; | 125 return; |
| 126 m_numProgressTrackedFrames--; | 126 m_numProgressTrackedFrames--; |
| 127 if (!m_numProgressTrackedFrames || m_originatingProgressFrame == frame) | 127 if (!m_numProgressTrackedFrames || m_originatingProgressFrame == frame) |
| 128 finalProgressComplete(); | 128 finalProgressComplete(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void ProgressTracker::finalProgressComplete() | 131 void ProgressTracker::finalProgressComplete() |
| 132 { | 132 { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return; | 233 return; |
| 234 | 234 |
| 235 // Adjust the total expected bytes to account for any overage/underage. | 235 // Adjust the total expected bytes to account for any overage/underage. |
| 236 long long delta = item->bytesReceived - item->estimatedLength; | 236 long long delta = item->bytesReceived - item->estimatedLength; |
| 237 m_totalPageAndResourceBytesToLoad += delta; | 237 m_totalPageAndResourceBytesToLoad += delta; |
| 238 | 238 |
| 239 m_progressItems.remove(identifier); | 239 m_progressItems.remove(identifier); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } | 242 } |
| OLD | NEW |