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

Side by Side Diff: Source/core/xml/XMLHttpRequest.h

Issue 521363002: Make XHR use the background HTML parser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address tyoshino-san review / more comments Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@nypop.com>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * Copyright (C) 2012 Intel Corporation 5 * Copyright (C) 2012 Intel Corporation
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lin eNumber; } 143 void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lin eNumber; }
144 void setLastSendURL(const String& url) { m_lastSendURL = url; } 144 void setLastSendURL(const String& url) { m_lastSendURL = url; }
145 145
146 XMLHttpRequestUpload* upload(); 146 XMLHttpRequestUpload* upload();
147 147
148 DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); 148 DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange);
149 149
150 virtual void trace(Visitor*) OVERRIDE; 150 virtual void trace(Visitor*) OVERRIDE;
151 151
152 static XMLHttpRequest* findInstancePendingDocumentParse(Document*);
153
154 // This is only to be called from |Document::finishedParsing|.
155 // When we use the off-thread HTML parser, we don't have a complete document just after |HTMLDocumentParser::finish()|.
tyoshino (SeeGerritForStatus) 2014/09/02 04:12:16 let's wrap comments in 80 col
kouhei (in TOK) 2014/09/02 16:17:27 Done.
156 // This method is used to notify that the response document is completely bu ilt.
157 void didFinishParsingDocument();
158
152 private: 159 private:
153 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); 160 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>);
154 161
155 Document* document() const; 162 Document* document() const;
156 SecurityOrigin* securityOrigin() const; 163 SecurityOrigin* securityOrigin() const;
157 164
158 virtual void didSendData(unsigned long long bytesSent, unsigned long long to talBytesToBeSent) OVERRIDE; 165 virtual void didSendData(unsigned long long bytesSent, unsigned long long to talBytesToBeSent) OVERRIDE;
159 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp onse&) OVERRIDE; 166 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp onse&) OVERRIDE;
160 virtual void didReceiveData(const char* data, int dataLength) OVERRIDE; 167 virtual void didReceiveData(const char* data, int dataLength) OVERRIDE;
161 // When responseType is set to "blob", didDownloadData() is called instead 168 // When responseType is set to "blob", didDownloadData() is called instead
162 // of didReceiveData(). 169 // of didReceiveData().
163 virtual void didDownloadData(int dataLength) OVERRIDE; 170 virtual void didDownloadData(int dataLength) OVERRIDE;
164 virtual void didFinishLoading(unsigned long identifier, double finishTime) O VERRIDE; 171 virtual void didFinishLoading(unsigned long identifier, double finishTime) O VERRIDE;
165 virtual void didFail(const ResourceError&) OVERRIDE; 172 virtual void didFail(const ResourceError&) OVERRIDE;
166 virtual void didFailRedirectCheck() OVERRIDE; 173 virtual void didFailRedirectCheck() OVERRIDE;
167 174
175 void endLoading();
176
168 // Returns the MIME type part of m_mimeTypeOverride if present and 177 // Returns the MIME type part of m_mimeTypeOverride if present and
169 // successfully parsed, or returns one of the "Content-Type" header value 178 // successfully parsed, or returns one of the "Content-Type" header value
170 // of the received response. 179 // of the received response.
171 // 180 //
172 // This method is named after the term "final MIME type" defined in the 181 // This method is named after the term "final MIME type" defined in the
173 // spec but doesn't convert the result to ASCII lowercase as specified in 182 // spec but doesn't convert the result to ASCII lowercase as specified in
174 // the spec. Must be lowered later or compared using case insensitive 183 // the spec. Must be lowered later or compared using case insensitive
175 // comparison functions if required. 184 // comparison functions if required.
176 AtomicString finalResponseMIMEType() const; 185 AtomicString finalResponseMIMEType() const;
177 // The same as finalResponseMIMEType() but fallbacks to "text/xml" if 186 // The same as finalResponseMIMEType() but fallbacks to "text/xml" if
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // Not converted to ASCII lowercase. Must be lowered later or compared 245 // Not converted to ASCII lowercase. Must be lowered later or compared
237 // using case insensitive comparison functions if needed. 246 // using case insensitive comparison functions if needed.
238 AtomicString m_mimeTypeOverride; 247 AtomicString m_mimeTypeOverride;
239 unsigned long m_timeoutMilliseconds; 248 unsigned long m_timeoutMilliseconds;
240 RefPtrWillBeMember<Blob> m_responseBlob; 249 RefPtrWillBeMember<Blob> m_responseBlob;
241 RefPtrWillBeMember<Stream> m_responseLegacyStream; 250 RefPtrWillBeMember<Stream> m_responseLegacyStream;
242 PersistentWillBeMember<ReadableStreamImpl<ReadableStreamChunkTypeTraits<Arra yBuffer> > > m_responseStream; 251 PersistentWillBeMember<ReadableStreamImpl<ReadableStreamChunkTypeTraits<Arra yBuffer> > > m_responseStream;
243 PersistentWillBeMember<UnderlyingSource> m_streamSource; 252 PersistentWillBeMember<UnderlyingSource> m_streamSource;
244 253
245 RefPtr<ThreadableLoader> m_loader; 254 RefPtr<ThreadableLoader> m_loader;
255 unsigned long m_loaderIdentifier;
246 State m_state; 256 State m_state;
247 257
248 ResourceResponse m_response; 258 ResourceResponse m_response;
249 String m_finalResponseCharset; 259 String m_finalResponseCharset;
250 260
251 OwnPtr<TextResourceDecoder> m_decoder; 261 OwnPtr<TextResourceDecoder> m_decoder;
252 262
253 ScriptString m_responseText; 263 ScriptString m_responseText;
254 RefPtrWillBeMember<Document> m_responseDocument; 264 RefPtrWillBeMember<Document> m_responseDocument;
255 RefPtrWillBeMember<DocumentParser> m_responseDocumentParser; 265 RefPtrWillBeMember<DocumentParser> m_responseDocumentParser;
(...skipping 26 matching lines...) Expand all
282 bool m_parsedResponse; 292 bool m_parsedResponse;
283 bool m_error; 293 bool m_error;
284 bool m_uploadEventsAllowed; 294 bool m_uploadEventsAllowed;
285 bool m_uploadComplete; 295 bool m_uploadComplete;
286 bool m_sameOriginRequest; 296 bool m_sameOriginRequest;
287 }; 297 };
288 298
289 } // namespace blink 299 } // namespace blink
290 300
291 #endif // XMLHttpRequest_h 301 #endif // XMLHttpRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698