OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef Response_h | 5 #ifndef Response_h |
6 #define Response_h | 6 #define Response_h |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "bindings/modules/v8/UnionTypesModules.h" | 11 #include "bindings/modules/v8/UnionTypesModules.h" |
11 #include "modules/ModulesExport.h" | 12 #include "modules/ModulesExport.h" |
12 #include "modules/fetch/Body.h" | 13 #include "modules/fetch/Body.h" |
13 #include "modules/fetch/BodyStreamBuffer.h" | 14 #include "modules/fetch/BodyStreamBuffer.h" |
14 #include "modules/fetch/FetchResponseData.h" | 15 #include "modules/fetch/FetchResponseData.h" |
15 #include "modules/fetch/Headers.h" | 16 #include "modules/fetch/Headers.h" |
16 #include "platform/blob/BlobData.h" | 17 #include "platform/blob/BlobData.h" |
17 #include "platform/heap/Handle.h" | 18 #include "platform/heap/Handle.h" |
18 #include "wtf/PassOwnPtr.h" | 19 #include "wtf/PassOwnPtr.h" |
19 | 20 |
20 namespace blink { | 21 namespace blink { |
21 | 22 |
22 class Blob; | 23 class Blob; |
23 class DOMArrayBuffer; | 24 class DOMArrayBuffer; |
24 class ExceptionState; | 25 class ExceptionState; |
25 class FetchDataConsumerHandle; | 26 class FetchDataConsumerHandle; |
26 class ResponseInit; | 27 class ResponseInit; |
| 28 class ScriptState; |
27 class WebServiceWorkerResponse; | 29 class WebServiceWorkerResponse; |
28 | 30 |
29 typedef BlobOrArrayBufferOrArrayBufferViewOrFormDataOrUSVString BodyInit; | |
30 | |
31 class MODULES_EXPORT Response final : public Body { | 31 class MODULES_EXPORT Response final : public Body { |
32 DEFINE_WRAPPERTYPEINFO(); | 32 DEFINE_WRAPPERTYPEINFO(); |
33 WTF_MAKE_NONCOPYABLE(Response); | 33 WTF_MAKE_NONCOPYABLE(Response); |
34 public: | 34 public: |
35 ~Response() override { } | 35 ~Response() override { } |
36 | 36 |
37 // From Response.idl: | 37 // From Response.idl: |
38 static Response* create(ExecutionContext*, ExceptionState&); | 38 static Response* create(ScriptState*, ExceptionState&); |
39 static Response* create(ExecutionContext*, const BodyInit&, const Dictionary
&, ExceptionState&); | 39 static Response* create(ScriptState*, ScriptValue body, const Dictionary&, E
xceptionState&); |
40 | 40 |
41 static Response* create(ExecutionContext*, PassOwnPtr<FetchDataConsumerHandl
e> bodyHandle, const String& contentType, const ResponseInit&, ExceptionState&); | 41 static Response* create(ExecutionContext*, PassOwnPtr<FetchDataConsumerHandl
e> bodyHandle, const String& contentType, const ResponseInit&, ExceptionState&); |
42 static Response* create(ExecutionContext*, FetchResponseData*); | 42 static Response* create(ExecutionContext*, FetchResponseData*); |
43 static Response* create(ExecutionContext*, const WebServiceWorkerResponse&); | 43 static Response* create(ExecutionContext*, const WebServiceWorkerResponse&); |
44 | 44 |
45 static Response* createClone(const Response&); | 45 static Response* createClone(const Response&); |
46 | 46 |
47 static Response* error(ExecutionContext*); | 47 static Response* error(ExecutionContext*); |
48 static Response* redirect(ExecutionContext*, const String& url, unsigned sho
rt status, ExceptionState&); | 48 static Response* redirect(ExecutionContext*, const String& url, unsigned sho
rt status, ExceptionState&); |
49 | 49 |
(...skipping 33 matching lines...) Loading... |
83 Response(ExecutionContext*, FetchResponseData*); | 83 Response(ExecutionContext*, FetchResponseData*); |
84 Response(ExecutionContext*, FetchResponseData*, Headers*); | 84 Response(ExecutionContext*, FetchResponseData*, Headers*); |
85 | 85 |
86 const Member<FetchResponseData> m_response; | 86 const Member<FetchResponseData> m_response; |
87 const Member<Headers> m_headers; | 87 const Member<Headers> m_headers; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
91 | 91 |
92 #endif // Response_h | 92 #endif // Response_h |
OLD | NEW |