XMLHttpRequestUpload's loadstart event not correct initialized
[WebKit-https.git] / Source / WebCore / xml / XMLHttpRequest.cpp
index d868ddf..3b15c80 100644 (file)
@@ -714,7 +714,6 @@ bool XMLHttpRequest::internalAbort()
 void XMLHttpRequest::clearResponse()
 {
     m_response = ResourceResponse();
-    m_didReceiveResponseHandler = nullptr;
     clearResponseBuffers();
 }
 
@@ -946,14 +945,6 @@ void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon
     if (!m_upload)
         return;
 
-    if (m_response.isNull()) {
-        // We should not notify of progress until we've received a response from the server.
-        m_didReceiveResponseHandler = [this, bytesSent, totalBytesToBeSent] {
-            didSendData(bytesSent, totalBytesToBeSent);
-        };
-        return;
-    }
-
     if (m_uploadListenerFlag)
         m_upload->dispatchProgressEvent(eventNames().progressEvent, bytesSent, totalBytesToBeSent);
 
@@ -969,8 +960,6 @@ void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon
 void XMLHttpRequest::didReceiveResponse(unsigned long, const ResourceResponse& response)
 {
     m_response = response;
-    if (auto didReceiveResponseHandler = WTFMove(m_didReceiveResponseHandler))
-        didReceiveResponseHandler();
 }
 
 static inline bool shouldDecodeResponse(XMLHttpRequest::ResponseType type)