Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1548)

Unified Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 60203010: XHR.abort(): no event dispatching in completed/non-started states. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 0d4d2feccf831abf29a42c4dbe624d482954e540..2dbc810eded218b7ad79de94938bc43cd2695013 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -856,14 +856,16 @@ void XMLHttpRequest::abort()
// Clear headers as required by the spec
m_requestHeaders.clear();
- if ((m_state <= OPENED && !sendFlag) || m_state == DONE)
- m_state = UNSENT;
- else {
- ASSERT(!m_loader);
- changeState(DONE);
+ if ((m_state <= OPENED && !sendFlag) || m_state == DONE) {
+ // No readystatechange event is dispatched.
m_state = UNSENT;
+ return;
}
+ ASSERT(!m_loader);
+ changeState(DONE);
+ m_state = UNSENT;
+
m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(EventTypeNames::abort));
if (!m_uploadComplete) {
m_uploadComplete = true;

Powered by Google App Engine
This is Rietveld 408576698