| 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 30 matching lines...) Expand all Loading... |
| 41 #include "platform/weborigin/SecurityOrigin.h" | 41 #include "platform/weborigin/SecurityOrigin.h" |
| 42 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
| 43 #include "wtf/PassRefPtr.h" | 43 #include "wtf/PassRefPtr.h" |
| 44 #include "wtf/RefPtr.h" | 44 #include "wtf/RefPtr.h" |
| 45 #include "wtf/text/AtomicString.h" | 45 #include "wtf/text/AtomicString.h" |
| 46 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
| 47 #include <memory> | 47 #include <memory> |
| 48 | 48 |
| 49 namespace blink { | 49 namespace blink { |
| 50 | 50 |
| 51 class ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData; | 51 class |
| 52 ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormDataOrURLSearchPar
ams; |
| 52 class Blob; | 53 class Blob; |
| 53 class BlobDataHandle; | 54 class BlobDataHandle; |
| 54 class DOMArrayBuffer; | 55 class DOMArrayBuffer; |
| 55 class DOMArrayBufferView; | 56 class DOMArrayBufferView; |
| 56 class Document; | 57 class Document; |
| 57 class DocumentParser; | 58 class DocumentParser; |
| 58 class ExceptionState; | 59 class ExceptionState; |
| 59 class ExecutionContext; | 60 class ExecutionContext; |
| 60 class FormData; | 61 class FormData; |
| 61 class ScriptState; | 62 class ScriptState; |
| 62 class SharedBuffer; | 63 class SharedBuffer; |
| 63 class TextResourceDecoder; | 64 class TextResourceDecoder; |
| 64 class ThreadableLoader; | 65 class ThreadableLoader; |
| 66 class URLSearchParams; |
| 65 class WebDataConsumerHandle; | 67 class WebDataConsumerHandle; |
| 66 class XMLHttpRequestUpload; | 68 class XMLHttpRequestUpload; |
| 67 | 69 |
| 68 class XMLHttpRequest final : public XMLHttpRequestEventTarget, | 70 class XMLHttpRequest final : public XMLHttpRequestEventTarget, |
| 69 private ThreadableLoaderClient, | 71 private ThreadableLoaderClient, |
| 70 public DocumentParserClient, | 72 public DocumentParserClient, |
| 71 public ActiveScriptWrappable<XMLHttpRequest>, | 73 public ActiveScriptWrappable<XMLHttpRequest>, |
| 72 public SuspendableObject { | 74 public SuspendableObject { |
| 73 DEFINE_WRAPPERTYPEINFO(); | 75 DEFINE_WRAPPERTYPEINFO(); |
| 74 USING_GARBAGE_COLLECTED_MIXIN(XMLHttpRequest); | 76 USING_GARBAGE_COLLECTED_MIXIN(XMLHttpRequest); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 const String& url, | 128 const String& url, |
| 127 bool async, | 129 bool async, |
| 128 const String& username, | 130 const String& username, |
| 129 const String& password, | 131 const String& password, |
| 130 ExceptionState&); | 132 ExceptionState&); |
| 131 void open(const AtomicString& method, | 133 void open(const AtomicString& method, |
| 132 const KURL&, | 134 const KURL&, |
| 133 bool async, | 135 bool async, |
| 134 ExceptionState&); | 136 ExceptionState&); |
| 135 void send( | 137 void send( |
| 136 const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData&, | 138 const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormDataOrURLS
earchParams&, |
| 137 ExceptionState&); | 139 ExceptionState&); |
| 138 void abort(); | 140 void abort(); |
| 139 void dispose(); | 141 void dispose(); |
| 140 void setRequestHeader(const AtomicString& name, | 142 void setRequestHeader(const AtomicString& name, |
| 141 const AtomicString& value, | 143 const AtomicString& value, |
| 142 ExceptionState&); | 144 ExceptionState&); |
| 143 void overrideMimeType(const AtomicString& override, ExceptionState&); | 145 void overrideMimeType(const AtomicString& override, ExceptionState&); |
| 144 String getAllResponseHeaders() const; | 146 String getAllResponseHeaders() const; |
| 145 const AtomicString& getResponseHeader(const AtomicString&) const; | 147 const AtomicString& getResponseHeader(const AtomicString&) const; |
| 146 ScriptString responseText(ExceptionState&); | 148 ScriptString responseText(ExceptionState&); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 bool areMethodAndURLValidForSend(); | 229 bool areMethodAndURLValidForSend(); |
| 228 | 230 |
| 229 void throwForLoadFailureIfNeeded(ExceptionState&, const String&); | 231 void throwForLoadFailureIfNeeded(ExceptionState&, const String&); |
| 230 | 232 |
| 231 bool initSend(ExceptionState&); | 233 bool initSend(ExceptionState&); |
| 232 void sendBytesData(const void*, size_t, ExceptionState&); | 234 void sendBytesData(const void*, size_t, ExceptionState&); |
| 233 void send(Document*, ExceptionState&); | 235 void send(Document*, ExceptionState&); |
| 234 void send(const String&, ExceptionState&); | 236 void send(const String&, ExceptionState&); |
| 235 void send(Blob*, ExceptionState&); | 237 void send(Blob*, ExceptionState&); |
| 236 void send(FormData*, ExceptionState&); | 238 void send(FormData*, ExceptionState&); |
| 239 void send(URLSearchParams*, ExceptionState&); |
| 237 void send(DOMArrayBuffer*, ExceptionState&); | 240 void send(DOMArrayBuffer*, ExceptionState&); |
| 238 void send(DOMArrayBufferView*, ExceptionState&); | 241 void send(DOMArrayBufferView*, ExceptionState&); |
| 239 | 242 |
| 240 const AtomicString& getRequestHeader(const AtomicString& name) const; | 243 const AtomicString& getRequestHeader(const AtomicString& name) const; |
| 241 void setRequestHeaderInternal(const AtomicString& name, | 244 void setRequestHeaderInternal(const AtomicString& name, |
| 242 const AtomicString& value); | 245 const AtomicString& value); |
| 243 | 246 |
| 244 void trackProgress(long long dataLength); | 247 void trackProgress(long long dataLength); |
| 245 // Changes m_state and dispatches a readyStateChange event if new m_state | 248 // Changes m_state and dispatches a readyStateChange event if new m_state |
| 246 // value is different from last one. | 249 // value is different from last one. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 270 // cancellation when the frame containing the XHR navigates away. | 273 // cancellation when the frame containing the XHR navigates away. |
| 271 void handleDidCancel(); | 274 void handleDidCancel(); |
| 272 // Handles didFail() call for timeout. | 275 // Handles didFail() call for timeout. |
| 273 void handleDidTimeout(); | 276 void handleDidTimeout(); |
| 274 | 277 |
| 275 void handleRequestError(ExceptionCode, | 278 void handleRequestError(ExceptionCode, |
| 276 const AtomicString&, | 279 const AtomicString&, |
| 277 long long, | 280 long long, |
| 278 long long); | 281 long long); |
| 279 | 282 |
| 283 void updateContentTypeAndCharset(const AtomicString& contentType, |
| 284 const String& charset); |
| 285 |
| 280 XMLHttpRequestProgressEventThrottle& progressEventThrottle(); | 286 XMLHttpRequestProgressEventThrottle& progressEventThrottle(); |
| 281 | 287 |
| 282 Member<XMLHttpRequestUpload> m_upload; | 288 Member<XMLHttpRequestUpload> m_upload; |
| 283 | 289 |
| 284 KURL m_url; | 290 KURL m_url; |
| 285 AtomicString m_method; | 291 AtomicString m_method; |
| 286 HTTPHeaderMap m_requestHeaders; | 292 HTTPHeaderMap m_requestHeaders; |
| 287 // Not converted to ASCII lowercase. Must be lowered later or compared | 293 // Not converted to ASCII lowercase. Must be lowered later or compared |
| 288 // using case insensitive comparison functions if needed. | 294 // using case insensitive comparison functions if needed. |
| 289 AtomicString m_mimeTypeOverride; | 295 AtomicString m_mimeTypeOverride; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 bool m_downloadingToFile; | 355 bool m_downloadingToFile; |
| 350 bool m_responseTextOverflow; | 356 bool m_responseTextOverflow; |
| 351 bool m_sendFlag; | 357 bool m_sendFlag; |
| 352 }; | 358 }; |
| 353 | 359 |
| 354 std::ostream& operator<<(std::ostream&, const XMLHttpRequest*); | 360 std::ostream& operator<<(std::ostream&, const XMLHttpRequest*); |
| 355 | 361 |
| 356 } // namespace blink | 362 } // namespace blink |
| 357 | 363 |
| 358 #endif // XMLHttpRequest_h | 364 #endif // XMLHttpRequest_h |
| OLD | NEW |