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

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

Issue 521403002: XHR: Abort DocumentParser on internalAbort (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add tests Created 6 years, 4 months 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 0133c246396b3a46e04566d65fcb0f683429f827..5d1979176606a13ed6a09d9ed92e6b2ea6dbbf97 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -914,6 +914,13 @@ void XMLHttpRequest::clearVariablesForLoading()
{
m_decoder.clear();
+ if (m_responseDocumentParser) {
+#if !ENABLE(OILPAN)
+ m_responseDocumentParser->detach();
+#endif
+ m_responseDocumentParser = nullptr;
+ }
+
m_finalResponseCharset = String();
}
@@ -921,6 +928,9 @@ bool XMLHttpRequest::internalAbort()
{
m_error = true;
+ if (m_responseDocumentParser && m_responseDocumentParser->isStopped())
tyoshino (SeeGerritForStatus) 2014/09/01 05:06:05 I guess you wanted !m_responseDocumentParser->isS
kouhei (in TOK) 2014/09/01 05:16:57 Done.
+ m_responseDocumentParser->stopParsing();
+
clearVariablesForLoading();
InspectorInstrumentation::didFailXHRLoading(executionContext(), this, this);
@@ -971,7 +981,6 @@ void XMLHttpRequest::clearResponse()
m_parsedResponse = false;
m_responseDocument = nullptr;
- m_responseDocumentParser = nullptr;
m_responseBlob = nullptr;
m_downloadedBlobLength = 0;

Powered by Google App Engine
This is Rietveld 408576698