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

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

Issue 454313002: [WIP] XMLHttpRequest should parse as it receives chunks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add test 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.h
diff --git a/Source/core/xml/XMLHttpRequest.h b/Source/core/xml/XMLHttpRequest.h
index a17d17314b2b614e6ebced02c1dde15843217c60..a0b7fe1075deb69f00cb199d8b5903451c4ee754 100644
--- a/Source/core/xml/XMLHttpRequest.h
+++ b/Source/core/xml/XMLHttpRequest.h
@@ -41,6 +41,7 @@ namespace blink {
class Blob;
class DOMFormData;
class Document;
+class DocumentParser;
class ExceptionState;
class ResourceRequest;
class SecurityOrigin;
@@ -163,6 +164,11 @@ private:
AtomicString responseMIMEType() const;
bool responseIsXML() const;
+ PassOwnPtr<TextResourceDecoder> createDecoder() const;
+
+ void initResponseDocument();
+ void parseDocumentChunk(const char* data, int dataLength);
+
bool areMethodAndURLValidForSend();
bool initSend(ExceptionState&);
@@ -224,6 +230,7 @@ private:
ScriptString m_responseText;
RefPtrWillBeMember<Document> m_responseDocument;
+ RefPtrWillBeMember<DocumentParser> m_documentParser;
RefPtr<SharedBuffer> m_binaryResponseBuilder;
long long m_downloadedBlobLength;
@@ -252,7 +259,7 @@ private:
bool m_includeCredentials;
// Used to skip m_responseDocument creation if it's done previously. We need
// this separate flag since m_responseDocument can be 0 for some cases.
- bool m_createdDocument;
+ bool m_parsedResponse;
bool m_error;
bool m_uploadEventsAllowed;
bool m_uploadComplete;

Powered by Google App Engine
This is Rietveld 408576698