Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 23 #define XMLHttpRequest_h | 23 #define XMLHttpRequest_h |
| 24 | 24 |
| 25 #include "bindings/v8/ScriptString.h" | 25 #include "bindings/v8/ScriptString.h" |
| 26 #include "bindings/v8/ScriptWrappable.h" | 26 #include "bindings/v8/ScriptWrappable.h" |
| 27 #include "core/dom/ActiveDOMObject.h" | 27 #include "core/dom/ActiveDOMObject.h" |
| 28 #include "core/events/EventListener.h" | 28 #include "core/events/EventListener.h" |
| 29 #include "core/events/ThreadLocalEventNames.h" | 29 #include "core/events/ThreadLocalEventNames.h" |
| 30 #include "core/loader/ThreadableLoaderClient.h" | 30 #include "core/loader/ThreadableLoaderClient.h" |
| 31 #include "core/xml/XMLHttpRequestEventTarget.h" | 31 #include "core/xml/XMLHttpRequestEventTarget.h" |
| 32 #include "core/xml/XMLHttpRequestProgressEventThrottle.h" | 32 #include "core/xml/XMLHttpRequestProgressEventThrottle.h" |
| 33 #include "heap/Handle.h" | |
| 33 #include "platform/AsyncMethodRunner.h" | 34 #include "platform/AsyncMethodRunner.h" |
| 34 #include "platform/network/FormData.h" | 35 #include "platform/network/FormData.h" |
| 35 #include "platform/network/ResourceResponse.h" | 36 #include "platform/network/ResourceResponse.h" |
| 36 #include "platform/weborigin/SecurityOrigin.h" | 37 #include "platform/weborigin/SecurityOrigin.h" |
| 37 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
| 38 #include "wtf/text/AtomicStringHash.h" | 39 #include "wtf/text/AtomicStringHash.h" |
| 39 #include "wtf/text/StringBuilder.h" | 40 #include "wtf/text/StringBuilder.h" |
| 40 | 41 |
| 41 namespace WebCore { | 42 namespace WebCore { |
| 42 | 43 |
| 43 class Blob; | 44 class Blob; |
| 44 class DOMFormData; | 45 class DOMFormData; |
| 45 class Document; | 46 class Document; |
| 46 class ExceptionState; | 47 class ExceptionState; |
| 47 class ResourceRequest; | 48 class ResourceRequest; |
| 48 class SecurityOrigin; | 49 class SecurityOrigin; |
| 49 class SharedBuffer; | 50 class SharedBuffer; |
| 50 class Stream; | 51 class Stream; |
| 51 class TextResourceDecoder; | 52 class TextResourceDecoder; |
| 52 class ThreadableLoader; | 53 class ThreadableLoader; |
| 53 | 54 |
| 54 typedef int ExceptionCode; | 55 typedef int ExceptionCode; |
| 55 | 56 |
| 56 class XMLHttpRequest FINAL : public ScriptWrappable, public RefCounted<XMLHttpRe quest>, public XMLHttpRequestEventTarget, private ThreadableLoaderClient, public ActiveDOMObject { | 57 class XMLHttpRequest FINAL : public RefCountedWillBeRefCountedGarbageCollected<X MLHttpRequest>, public ScriptWrappable, public XMLHttpRequestEventTarget, privat e ThreadableLoaderClient, public ActiveDOMObject { |
|
sof
2014/02/19 12:22:11
Just making a note of it here.. a followup here is
haraken
2014/02/19 12:26:50
Nice catch. I'll move XMLHttpRequestEventTarget an
| |
| 57 WTF_MAKE_FAST_ALLOCATED; | 58 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 58 REFCOUNTED_EVENT_TARGET(XMLHttpRequest); | 59 DECLARE_GC_INFO; |
| 60 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<X MLHttpRequest>); | |
| 59 public: | 61 public: |
| 60 static PassRefPtr<XMLHttpRequest> create(ExecutionContext*, PassRefPtr<Secur ityOrigin> = 0); | 62 static PassRefPtrWillBeRawPtr<XMLHttpRequest> create(ExecutionContext*, Pass RefPtr<SecurityOrigin> = 0); |
| 61 virtual ~XMLHttpRequest(); | 63 virtual ~XMLHttpRequest(); |
| 62 | 64 |
| 63 // These exact numeric values are important because JS expects them. | 65 // These exact numeric values are important because JS expects them. |
| 64 enum State { | 66 enum State { |
| 65 UNSENT = 0, | 67 UNSENT = 0, |
| 66 OPENED = 1, | 68 OPENED = 1, |
| 67 HEADERS_RECEIVED = 2, | 69 HEADERS_RECEIVED = 2, |
| 68 LOADING = 3, | 70 LOADING = 3, |
| 69 DONE = 4 | 71 DONE = 4 |
| 70 }; | 72 }; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 // response attribute has custom getter. | 138 // response attribute has custom getter. |
| 137 ArrayBuffer* responseArrayBuffer(); | 139 ArrayBuffer* responseArrayBuffer(); |
| 138 | 140 |
| 139 void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lin eNumber; } | 141 void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lin eNumber; } |
| 140 void setLastSendURL(const String& url) { m_lastSendURL = url; } | 142 void setLastSendURL(const String& url) { m_lastSendURL = url; } |
| 141 | 143 |
| 142 XMLHttpRequestUpload* upload(); | 144 XMLHttpRequestUpload* upload(); |
| 143 | 145 |
| 144 DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); | 146 DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); |
| 145 | 147 |
| 148 void trace(Visitor*) { } | |
| 149 | |
| 146 private: | 150 private: |
| 147 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); | 151 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); |
| 148 | 152 |
| 149 Document* document() const; | 153 Document* document() const; |
| 150 SecurityOrigin* securityOrigin() const; | 154 SecurityOrigin* securityOrigin() const; |
| 151 | 155 |
| 152 virtual void didSendData(unsigned long long bytesSent, unsigned long long to talBytesToBeSent) OVERRIDE; | 156 virtual void didSendData(unsigned long long bytesSent, unsigned long long to talBytesToBeSent) OVERRIDE; |
| 153 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp onse&) OVERRIDE; | 157 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp onse&) OVERRIDE; |
| 154 virtual void didReceiveData(const char* data, int dataLength) OVERRIDE; | 158 virtual void didReceiveData(const char* data, int dataLength) OVERRIDE; |
| 155 // When "blob" is specified as the responseType attribute, didDownloadData | 159 // When "blob" is specified as the responseType attribute, didDownloadData |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 | 265 |
| 262 // An enum corresponding to the allowed string values for the responseType a ttribute. | 266 // An enum corresponding to the allowed string values for the responseType a ttribute. |
| 263 ResponseTypeCode m_responseTypeCode; | 267 ResponseTypeCode m_responseTypeCode; |
| 264 AsyncMethodRunner<XMLHttpRequest> m_dropProtectionRunner; | 268 AsyncMethodRunner<XMLHttpRequest> m_dropProtectionRunner; |
| 265 RefPtr<SecurityOrigin> m_securityOrigin; | 269 RefPtr<SecurityOrigin> m_securityOrigin; |
| 266 }; | 270 }; |
| 267 | 271 |
| 268 } // namespace WebCore | 272 } // namespace WebCore |
| 269 | 273 |
| 270 #endif // XMLHttpRequest_h | 274 #endif // XMLHttpRequest_h |
| OLD | NEW |