| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right reserv
ed. | 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right reserv
ed. |
| 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 if (!isActive()) { | 59 if (!isActive()) { |
| 60 // The timer is not active so the least frequent event for now is every
byte. | 60 // The timer is not active so the least frequent event for now is every
byte. |
| 61 // Just go ahead and dispatch the event. | 61 // Just go ahead and dispatch the event. |
| 62 | 62 |
| 63 // We should not have any pending loaded & total information from a prev
ious run. | 63 // We should not have any pending loaded & total information from a prev
ious run. |
| 64 ASSERT(!m_loaded); | 64 ASSERT(!m_loaded); |
| 65 ASSERT(!m_total); | 65 ASSERT(!m_total); |
| 66 | 66 |
| 67 dispatchEvent(XMLHttpRequestProgressEvent::create(EventTypeNames::progre
ss, lengthComputable, loaded, total)); | 67 dispatchEvent(XMLHttpRequestProgressEvent::create(EventTypeNames::progre
ss, lengthComputable, loaded, total)); |
| 68 startRepeating(minimumProgressEventDispatchingIntervalInSeconds); | 68 startRepeating(minimumProgressEventDispatchingIntervalInSeconds, FROM_HE
RE); |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // The timer is already active so minimumProgressEventDispatchingIntervalInS
econds is the least frequent event. | 72 // The timer is already active so minimumProgressEventDispatchingIntervalInS
econds is the least frequent event. |
| 73 m_lengthComputable = lengthComputable; | 73 m_lengthComputable = lengthComputable; |
| 74 m_loaded = loaded; | 74 m_loaded = loaded; |
| 75 m_total = total; | 75 m_total = total; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefP
tr<Event> event, ProgressEventAction progressEventAction) | 78 void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefP
tr<Event> event, ProgressEventAction progressEventAction) |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 if (m_deferredEvents.isEmpty() && !m_deferredProgressEvent) { | 207 if (m_deferredEvents.isEmpty() && !m_deferredProgressEvent) { |
| 208 m_deferEvents = false; | 208 m_deferEvents = false; |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // Do not dispatch events inline here, since ExecutionContext is iterating o
ver | 212 // Do not dispatch events inline here, since ExecutionContext is iterating o
ver |
| 213 // the list of active DOM objects to resume them, and any activated JS event
-handler | 213 // the list of active DOM objects to resume them, and any activated JS event
-handler |
| 214 // could insert new active DOM objects to the list. | 214 // could insert new active DOM objects to the list. |
| 215 // m_deferEvents is kept true until all deferred events have been dispatched
. | 215 // m_deferEvents is kept true until all deferred events have been dispatched
. |
| 216 m_dispatchDeferredEventsTimer.startOneShot(0); | 216 m_dispatchDeferredEventsTimer.startOneShot(0, FROM_HERE); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace WebCore | 219 } // namespace WebCore |
| OLD | NEW |