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

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: address comments 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
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 0133c246396b3a46e04566d65fcb0f683429f827..e6feca801baa3e4b3d1bd041a0a037de1fd3ca21 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())
+ 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;
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698