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, |
yhirano
2015/08/07 14:22:02
Please update the comment.
horo
2015/08/07 15:39:54
Done.
| |
26 // error, and opaque. Unless stated otherwise, it is default." | 26 // error, and opaque. Unless stated otherwise, it is default." |
27 enum Type { BasicType, CORSType, DefaultType, ErrorType, OpaqueType }; | 27 enum Type { BasicType, |
falken
2015/08/07 07:39:12
this formatting looks wrong
horo
2015/08/07 09:19:33
Done.
| |
28 CORSType, | |
29 DefaultType, | |
30 ErrorType, | |
31 OpaqueType, | |
32 OpaqueRedirectType }; | |
28 // "A response can have an associated termination reason which is one of | 33 // "A response can have an associated termination reason which is one of |
29 // end-user abort, fatal, and timeout." | 34 // end-user abort, fatal, and timeout." |
30 enum TerminationReason { EndUserAbortTermination, FatalTermination, TimeoutT ermination }; | 35 enum TerminationReason { EndUserAbortTermination, FatalTermination, TimeoutT ermination }; |
31 | 36 |
32 static FetchResponseData* create(); | 37 static FetchResponseData* create(); |
33 static FetchResponseData* createNetworkErrorResponse(); | 38 static FetchResponseData* createNetworkErrorResponse(); |
34 static FetchResponseData* createWithBuffer(BodyStreamBuffer*); | 39 static FetchResponseData* createWithBuffer(BodyStreamBuffer*); |
35 | 40 |
36 FetchResponseData* createBasicFilteredResponse(); | 41 FetchResponseData* createBasicFilteredResponse(); |
37 FetchResponseData* createCORSFilteredResponse(); | 42 FetchResponseData* createCORSFilteredResponse(); |
38 FetchResponseData* createOpaqueFilteredResponse(); | 43 FetchResponseData* createOpaqueFilteredResponse(); |
44 FetchResponseData* createOpaqueRedirectFilteredResponse(); | |
39 | 45 |
40 FetchResponseData* clone(ExecutionContext*); | 46 FetchResponseData* clone(ExecutionContext*); |
41 | 47 |
42 Type type() const { return m_type; } | 48 Type type() const { return m_type; } |
43 const KURL& url() const { return m_url; } | 49 const KURL& url() const { return m_url; } |
44 unsigned short status() const { return m_status; } | 50 unsigned short status() const { return m_status; } |
45 AtomicString statusMessage() const { return m_statusMessage; } | 51 AtomicString statusMessage() const { return m_statusMessage; } |
46 FetchHeaderList* headerList() const { return m_headerList.get(); } | 52 FetchHeaderList* headerList() const { return m_headerList.get(); } |
47 BodyStreamBuffer* buffer() const { return m_buffer; } | 53 BodyStreamBuffer* buffer() const { return m_buffer; } |
48 String mimeType() const; | 54 String mimeType() const; |
(...skipping 26 matching lines...) Expand all Loading... | |
75 AtomicString m_statusMessage; | 81 AtomicString m_statusMessage; |
76 Member<FetchHeaderList> m_headerList; | 82 Member<FetchHeaderList> m_headerList; |
77 Member<FetchResponseData> m_internalResponse; | 83 Member<FetchResponseData> m_internalResponse; |
78 Member<BodyStreamBuffer> m_buffer; | 84 Member<BodyStreamBuffer> m_buffer; |
79 String m_mimeType; | 85 String m_mimeType; |
80 }; | 86 }; |
81 | 87 |
82 } // namespace blink | 88 } // namespace blink |
83 | 89 |
84 #endif // FetchResponseData_h | 90 #endif // FetchResponseData_h |
OLD | NEW |