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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 DEFINE_TRACE(ProgressTracker) | 84 DEFINE_TRACE(ProgressTracker) |
85 { | 85 { |
86 visitor->trace(m_frame); | 86 visitor->trace(m_frame); |
87 } | 87 } |
88 | 88 |
89 void ProgressTracker::dispose() | 89 void ProgressTracker::dispose() |
90 { | 90 { |
91 if (m_frame->isLoading()) | 91 if (m_frame->isLoading()) |
92 progressCompleted(); | 92 progressCompleted(); |
93 ASSERT(!m_frame->isLoading()); | 93 DCHECK(!m_frame->isLoading()); |
94 } | 94 } |
95 | 95 |
96 double ProgressTracker::estimatedProgress() const | 96 double ProgressTracker::estimatedProgress() const |
97 { | 97 { |
98 return m_progressValue; | 98 return m_progressValue; |
99 } | 99 } |
100 | 100 |
101 void ProgressTracker::reset() | 101 void ProgressTracker::reset() |
102 { | 102 { |
103 m_progressItems.clear(); | 103 m_progressItems.clear(); |
104 m_progressValue = 0; | 104 m_progressValue = 0; |
105 m_lastNotifiedProgressValue = 0; | 105 m_lastNotifiedProgressValue = 0; |
106 m_lastNotifiedProgressTime = 0; | 106 m_lastNotifiedProgressTime = 0; |
107 m_finishedParsing = false; | 107 m_finishedParsing = false; |
108 } | 108 } |
109 | 109 |
110 void ProgressTracker::progressStarted() | 110 void ProgressTracker::progressStarted() |
111 { | 111 { |
112 if (!m_frame->isLoading()) | 112 if (!m_frame->isLoading()) |
113 m_frame->loader().client()->didStartLoading(NavigationToDifferentDocumen
t); | 113 m_frame->loader().client()->didStartLoading(NavigationToDifferentDocumen
t); |
114 reset(); | 114 reset(); |
115 m_progressValue = initialProgressValue; | 115 m_progressValue = initialProgressValue; |
116 m_frame->setIsLoading(true); | 116 m_frame->setIsLoading(true); |
117 InspectorInstrumentation::frameStartedLoading(m_frame); | 117 InspectorInstrumentation::frameStartedLoading(m_frame); |
118 } | 118 } |
119 | 119 |
120 void ProgressTracker::progressCompleted() | 120 void ProgressTracker::progressCompleted() |
121 { | 121 { |
122 ASSERT(m_frame->isLoading()); | 122 DCHECK(m_frame->isLoading()); |
123 m_frame->setIsLoading(false); | 123 m_frame->setIsLoading(false); |
124 sendFinalProgress(); | 124 sendFinalProgress(); |
125 reset(); | 125 reset(); |
126 m_frame->loader().client()->didStopLoading(); | 126 m_frame->loader().client()->didStopLoading(); |
127 InspectorInstrumentation::frameStoppedLoading(m_frame); | 127 InspectorInstrumentation::frameStoppedLoading(m_frame); |
128 } | 128 } |
129 | 129 |
130 void ProgressTracker::finishedParsing() | 130 void ProgressTracker::finishedParsing() |
131 { | 131 { |
132 m_finishedParsing = true; | 132 m_finishedParsing = true; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 { | 230 { |
231 ProgressItem* item = m_progressItems.get(identifier); | 231 ProgressItem* item = m_progressItems.get(identifier); |
232 if (!item) | 232 if (!item) |
233 return; | 233 return; |
234 | 234 |
235 item->estimatedLength = item->bytesReceived; | 235 item->estimatedLength = item->bytesReceived; |
236 maybeSendProgress(); | 236 maybeSendProgress(); |
237 } | 237 } |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
OLD | NEW |