| Index: Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
|
| diff --git a/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp b/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
|
| index 212bf9d835f6ac34a12bb0af191d57b750f6b36f..05e8179418323b53da9206d25330766e156f858d 100644
|
| --- a/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
|
| +++ b/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
|
| @@ -77,8 +77,10 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(bool lengthCompu
|
|
|
| void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtr<Event> event, ProgressEventAction progressEventAction)
|
| {
|
| - if (progressEventAction == FlushProgressEvent)
|
| - flushProgressEvent();
|
| + if (progressEventAction == FlushProgressEvent || progressEventAction == FlushDeferredProgressEvent) {
|
| + if (!flushDeferredProgressEvent() && progressEventAction == FlushProgressEvent)
|
| + deliverProgressEvent();
|
| + }
|
|
|
| dispatchEvent(event);
|
| }
|
| @@ -104,15 +106,19 @@ void XMLHttpRequestProgressEventThrottle::dispatchEventAndLoadEnd(PassRefPtr<Eve
|
| dispatchEvent(XMLHttpRequestProgressEvent::create(EventTypeNames::loadend));
|
| }
|
|
|
| -void XMLHttpRequestProgressEventThrottle::flushProgressEvent()
|
| +bool XMLHttpRequestProgressEventThrottle::flushDeferredProgressEvent()
|
| {
|
| if (m_deferEvents && m_deferredProgressEvent) {
|
| // Move the progress event to the queue, to get it in the right order on resume.
|
| m_deferredEvents.append(m_deferredProgressEvent);
|
| m_deferredProgressEvent = 0;
|
| - return;
|
| + return true;
|
| }
|
| + return false;
|
| +}
|
|
|
| +void XMLHttpRequestProgressEventThrottle::deliverProgressEvent()
|
| +{
|
| if (!hasEventToDispatch())
|
| return;
|
|
|
|
|