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 FetchResponseData_h | 5 #ifndef FetchResponseData_h |
6 #define FetchResponseData_h | 6 #define FetchResponseData_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "platform/weborigin/KURL.h" | 10 #include "platform/weborigin/KURL.h" |
11 #include "public/platform/WebServiceWorkerRequest.h" | 11 #include "public/platform/WebServiceWorkerRequest.h" |
12 #include "wtf/PassRefPtr.h" | 12 #include "wtf/PassRefPtr.h" |
13 #include "wtf/text/AtomicString.h" | 13 #include "wtf/text/AtomicString.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class BodyStreamBuffer; | 17 class BodyStreamBuffer; |
18 class ExecutionContext; | 18 class ExecutionContext; |
19 class FetchHeaderList; | 19 class FetchHeaderList; |
20 class WebServiceWorkerResponse; | 20 class WebServiceWorkerResponse; |
21 | 21 |
22 class MODULES_EXPORT FetchResponseData final : public GarbageCollectedFinalized<
FetchResponseData> { | 22 class MODULES_EXPORT FetchResponseData final : public GarbageCollectedFinalized<
FetchResponseData> { |
23 WTF_MAKE_NONCOPYABLE(FetchResponseData); | 23 WTF_MAKE_NONCOPYABLE(FetchResponseData); |
24 public: | 24 public: |
25 // "A response has an associated type which is one of basic, CORS, default, | 25 // "A response has an associated type which is one of basic, CORS, default, |
26 // error, and opaque. Unless stated otherwise, it is default." | 26 // error, opaque, and opaqueredirect. Unless stated otherwise, it is |
27 enum Type { BasicType, CORSType, DefaultType, ErrorType, OpaqueType }; | 27 // default." |
| 28 enum Type { BasicType, CORSType, DefaultType, ErrorType, OpaqueType, OpaqueR
edirectType }; |
28 // "A response can have an associated termination reason which is one of | 29 // "A response can have an associated termination reason which is one of |
29 // end-user abort, fatal, and timeout." | 30 // end-user abort, fatal, and timeout." |
30 enum TerminationReason { EndUserAbortTermination, FatalTermination, TimeoutT
ermination }; | 31 enum TerminationReason { EndUserAbortTermination, FatalTermination, TimeoutT
ermination }; |
31 | 32 |
32 static FetchResponseData* create(); | 33 static FetchResponseData* create(); |
33 static FetchResponseData* createNetworkErrorResponse(); | 34 static FetchResponseData* createNetworkErrorResponse(); |
34 static FetchResponseData* createWithBuffer(BodyStreamBuffer*); | 35 static FetchResponseData* createWithBuffer(BodyStreamBuffer*); |
35 | 36 |
36 FetchResponseData* createBasicFilteredResponse(); | 37 FetchResponseData* createBasicFilteredResponse(); |
37 FetchResponseData* createCORSFilteredResponse(); | 38 FetchResponseData* createCORSFilteredResponse(); |
38 FetchResponseData* createOpaqueFilteredResponse(); | 39 FetchResponseData* createOpaqueFilteredResponse(); |
| 40 FetchResponseData* createOpaqueRedirectFilteredResponse(); |
39 | 41 |
40 FetchResponseData* clone(ExecutionContext*); | 42 FetchResponseData* clone(ExecutionContext*); |
41 | 43 |
42 Type type() const { return m_type; } | 44 Type type() const { return m_type; } |
43 const KURL& url() const { return m_url; } | 45 const KURL& url() const { return m_url; } |
44 unsigned short status() const { return m_status; } | 46 unsigned short status() const { return m_status; } |
45 AtomicString statusMessage() const { return m_statusMessage; } | 47 AtomicString statusMessage() const { return m_statusMessage; } |
46 FetchHeaderList* headerList() const { return m_headerList.get(); } | 48 FetchHeaderList* headerList() const { return m_headerList.get(); } |
47 BodyStreamBuffer* buffer() const { return m_buffer; } | 49 BodyStreamBuffer* buffer() const { return m_buffer; } |
48 String mimeType() const; | 50 String mimeType() const; |
(...skipping 26 matching lines...) Expand all Loading... |
75 AtomicString m_statusMessage; | 77 AtomicString m_statusMessage; |
76 Member<FetchHeaderList> m_headerList; | 78 Member<FetchHeaderList> m_headerList; |
77 Member<FetchResponseData> m_internalResponse; | 79 Member<FetchResponseData> m_internalResponse; |
78 Member<BodyStreamBuffer> m_buffer; | 80 Member<BodyStreamBuffer> m_buffer; |
79 String m_mimeType; | 81 String m_mimeType; |
80 }; | 82 }; |
81 | 83 |
82 } // namespace blink | 84 } // namespace blink |
83 | 85 |
84 #endif // FetchResponseData_h | 86 #endif // FetchResponseData_h |
OLD | NEW |