| OLD | NEW |
| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/loader/ThreadableLoaderClient.h" | 30 #include "core/loader/ThreadableLoaderClient.h" |
| 31 #include "core/xmlhttprequest/XMLHttpRequestEventTarget.h" | 31 #include "core/xmlhttprequest/XMLHttpRequestEventTarget.h" |
| 32 #include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h" | 32 #include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h" |
| 33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 34 #include "platform/network/EncodedFormData.h" | 34 #include "platform/network/EncodedFormData.h" |
| 35 #include "platform/network/HTTPHeaderMap.h" | 35 #include "platform/network/HTTPHeaderMap.h" |
| 36 #include "platform/network/ResourceResponse.h" | 36 #include "platform/network/ResourceResponse.h" |
| 37 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 38 #include "platform/weborigin/SecurityOrigin.h" | 38 #include "platform/weborigin/SecurityOrigin.h" |
| 39 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
| 40 #include "wtf/OwnPtr.h" |
| 41 #include "wtf/PassOwnPtr.h" |
| 40 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
| 41 #include "wtf/RefPtr.h" | 43 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/AtomicString.h" | 44 #include "wtf/text/AtomicString.h" |
| 43 #include "wtf/text/StringBuilder.h" | 45 #include "wtf/text/StringBuilder.h" |
| 44 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
| 45 #include <memory> | |
| 46 | 47 |
| 47 namespace blink { | 48 namespace blink { |
| 48 | 49 |
| 49 class ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData; | 50 class ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData; |
| 50 class Blob; | 51 class Blob; |
| 51 class BlobDataHandle; | 52 class BlobDataHandle; |
| 52 class DOMArrayBuffer; | 53 class DOMArrayBuffer; |
| 53 class DOMArrayBufferView; | 54 class DOMArrayBufferView; |
| 54 class Document; | 55 class Document; |
| 55 class DocumentParser; | 56 class DocumentParser; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 DECLARE_VIRTUAL_TRACE(); | 150 DECLARE_VIRTUAL_TRACE(); |
| 150 | 151 |
| 151 private: | 152 private: |
| 152 class BlobLoader; | 153 class BlobLoader; |
| 153 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); | 154 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); |
| 154 | 155 |
| 155 Document* document() const; | 156 Document* document() const; |
| 156 SecurityOrigin* getSecurityOrigin() const; | 157 SecurityOrigin* getSecurityOrigin() const; |
| 157 | 158 |
| 158 void didSendData(unsigned long long bytesSent, unsigned long long totalBytes
ToBeSent) override; | 159 void didSendData(unsigned long long bytesSent, unsigned long long totalBytes
ToBeSent) override; |
| 159 void didReceiveResponse(unsigned long identifier, const ResourceResponse&, s
td::unique_ptr<WebDataConsumerHandle>) override; | 160 void didReceiveResponse(unsigned long identifier, const ResourceResponse&, P
assOwnPtr<WebDataConsumerHandle>) override; |
| 160 void didReceiveData(const char* data, unsigned dataLength) override; | 161 void didReceiveData(const char* data, unsigned dataLength) override; |
| 161 // When responseType is set to "blob", didDownloadData() is called instead | 162 // When responseType is set to "blob", didDownloadData() is called instead |
| 162 // of didReceiveData(). | 163 // of didReceiveData(). |
| 163 void didDownloadData(int dataLength) override; | 164 void didDownloadData(int dataLength) override; |
| 164 void didFinishLoading(unsigned long identifier, double finishTime) override; | 165 void didFinishLoading(unsigned long identifier, double finishTime) override; |
| 165 void didFail(const ResourceError&) override; | 166 void didFail(const ResourceError&) override; |
| 166 void didFailRedirectCheck() override; | 167 void didFailRedirectCheck() override; |
| 167 | 168 |
| 168 // BlobLoader notifications. | 169 // BlobLoader notifications. |
| 169 void didFinishLoadingInternal(); | 170 void didFinishLoadingInternal(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 185 // spec but doesn't convert the result to ASCII lowercase as specified in | 186 // spec but doesn't convert the result to ASCII lowercase as specified in |
| 186 // the spec. Must be lowered later or compared using case insensitive | 187 // the spec. Must be lowered later or compared using case insensitive |
| 187 // comparison functions if required. | 188 // comparison functions if required. |
| 188 AtomicString finalResponseMIMEType() const; | 189 AtomicString finalResponseMIMEType() const; |
| 189 // The same as finalResponseMIMEType() but fallbacks to "text/xml" if | 190 // The same as finalResponseMIMEType() but fallbacks to "text/xml" if |
| 190 // finalResponseMIMEType() returns an empty string. | 191 // finalResponseMIMEType() returns an empty string. |
| 191 AtomicString finalResponseMIMETypeWithFallback() const; | 192 AtomicString finalResponseMIMETypeWithFallback() const; |
| 192 bool responseIsXML() const; | 193 bool responseIsXML() const; |
| 193 bool responseIsHTML() const; | 194 bool responseIsHTML() const; |
| 194 | 195 |
| 195 std::unique_ptr<TextResourceDecoder> createDecoder() const; | 196 PassOwnPtr<TextResourceDecoder> createDecoder() const; |
| 196 | 197 |
| 197 void initResponseDocument(); | 198 void initResponseDocument(); |
| 198 void parseDocumentChunk(const char* data, unsigned dataLength); | 199 void parseDocumentChunk(const char* data, unsigned dataLength); |
| 199 | 200 |
| 200 bool areMethodAndURLValidForSend(); | 201 bool areMethodAndURLValidForSend(); |
| 201 | 202 |
| 202 void throwForLoadFailureIfNeeded(ExceptionState&, const String&); | 203 void throwForLoadFailureIfNeeded(ExceptionState&, const String&); |
| 203 | 204 |
| 204 bool initSend(ExceptionState&); | 205 bool initSend(ExceptionState&); |
| 205 void sendBytesData(const void*, size_t, ExceptionState&); | 206 void sendBytesData(const void*, size_t, ExceptionState&); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 KURL m_url; | 258 KURL m_url; |
| 258 AtomicString m_method; | 259 AtomicString m_method; |
| 259 HTTPHeaderMap m_requestHeaders; | 260 HTTPHeaderMap m_requestHeaders; |
| 260 // Not converted to ASCII lowercase. Must be lowered later or compared | 261 // Not converted to ASCII lowercase. Must be lowered later or compared |
| 261 // using case insensitive comparison functions if needed. | 262 // using case insensitive comparison functions if needed. |
| 262 AtomicString m_mimeTypeOverride; | 263 AtomicString m_mimeTypeOverride; |
| 263 unsigned long m_timeoutMilliseconds; | 264 unsigned long m_timeoutMilliseconds; |
| 264 Member<Blob> m_responseBlob; | 265 Member<Blob> m_responseBlob; |
| 265 Member<Stream> m_responseLegacyStream; | 266 Member<Stream> m_responseLegacyStream; |
| 266 | 267 |
| 267 std::unique_ptr<ThreadableLoader> m_loader; | 268 OwnPtr<ThreadableLoader> m_loader; |
| 268 State m_state; | 269 State m_state; |
| 269 | 270 |
| 270 ResourceResponse m_response; | 271 ResourceResponse m_response; |
| 271 String m_finalResponseCharset; | 272 String m_finalResponseCharset; |
| 272 | 273 |
| 273 std::unique_ptr<TextResourceDecoder> m_decoder; | 274 OwnPtr<TextResourceDecoder> m_decoder; |
| 274 | 275 |
| 275 ScriptString m_responseText; | 276 ScriptString m_responseText; |
| 276 Member<Document> m_responseDocument; | 277 Member<Document> m_responseDocument; |
| 277 Member<DocumentParser> m_responseDocumentParser; | 278 Member<DocumentParser> m_responseDocumentParser; |
| 278 | 279 |
| 279 RefPtr<SharedBuffer> m_binaryResponseBuilder; | 280 RefPtr<SharedBuffer> m_binaryResponseBuilder; |
| 280 long long m_lengthDownloadedToFile; | 281 long long m_lengthDownloadedToFile; |
| 281 | 282 |
| 282 Member<DOMArrayBuffer> m_responseArrayBuffer; | 283 Member<DOMArrayBuffer> m_responseArrayBuffer; |
| 283 | 284 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 bool m_sameOriginRequest; | 316 bool m_sameOriginRequest; |
| 316 // True iff the ongoing resource loading is using the downloadToFile | 317 // True iff the ongoing resource loading is using the downloadToFile |
| 317 // option. | 318 // option. |
| 318 bool m_downloadingToFile; | 319 bool m_downloadingToFile; |
| 319 bool m_responseTextOverflow; | 320 bool m_responseTextOverflow; |
| 320 }; | 321 }; |
| 321 | 322 |
| 322 } // namespace blink | 323 } // namespace blink |
| 323 | 324 |
| 324 #endif // XMLHttpRequest_h | 325 #endif // XMLHttpRequest_h |
| OLD | NEW |