Index: Source/core/xml/XMLHttpRequest.cpp |
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp |
index d263355af8508105b4306388040d991fe8ea86b1..75e0a1818d3044cf2658d6ec8e17906bee53b215 100644 |
--- a/Source/core/xml/XMLHttpRequest.cpp |
+++ b/Source/core/xml/XMLHttpRequest.cpp |
@@ -63,23 +63,12 @@ |
#include "wtf/ArrayBuffer.h" |
#include "wtf/ArrayBufferView.h" |
#include "wtf/Assertions.h" |
-#include "wtf/CurrentTime.h" |
#include "wtf/RefCountedLeakCounter.h" |
#include "wtf/StdLibExtras.h" |
#include "wtf/text/CString.h" |
namespace blink { |
-// To throttle readystatechange event fired when readystatechange is not |
-// changed, we don't dispatch the event within 50ms. |
-// As dispatching readystatechange when readystatechange is NOT changed is not |
-// specified, 50ms is not specified, too. |
-// We choose this value because progress event is dispatched every 50ms, but |
-// actually this value doesn't have to equal to the interval. |
-// Note: When readystate is actually changed readystatechange event must be |
-// dispatched no matter how recently dispatched the event was. |
-const double readyStateChangeFireInterval = 0.05; |
- |
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, xmlHttpRequestCounter, ("XMLHttpRequest")); |
static bool isSetCookieHeader(const AtomicString& name) |
@@ -162,7 +151,6 @@ XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri |
, m_progressEventThrottle(this) |
, m_responseTypeCode(ResponseTypeDefault) |
, m_securityOrigin(securityOrigin) |
- , m_previousReadyStateChangeFireTime(0) |
, m_async(true) |
, m_includeCredentials(false) |
, m_parsedResponse(false) |
@@ -452,15 +440,12 @@ void XMLHttpRequest::trackProgress(int length) |
if (m_state != LOADING) { |
changeState(LOADING); |
} else { |
- // FIXME: Make our implementation and the spec consistent. This extra |
- // invocation of readystatechange event in LOADING state was needed |
- // when the progress event was not available. |
- double now = monotonicallyIncreasingTime(); |
- bool shouldFire = now - m_previousReadyStateChangeFireTime >= readyStateChangeFireInterval; |
- if (shouldFire) { |
- m_previousReadyStateChangeFireTime = now; |
- dispatchReadyStateChangeEvent(); |
- } |
+ // Firefox calls readyStateChanged every time it receives data. Do |
tyoshino (SeeGerritForStatus)
2014/08/19 10:22:17
Changed -> Change
maybe my mistake...
yhirano1
2014/08/19 10:34:50
I will fix it in the future.
|
+ // the same to align with Firefox. |
+ // |
+ // FIXME: Make our implementation and the spec consistent. This |
+ // behavior was needed when the progress event was not available. |
+ dispatchReadyStateChangeEvent(); |
} |
} |