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; |