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 FetchRequestData_h | 5 #ifndef FetchRequestData_h |
6 #define FetchRequestData_h | 6 #define FetchRequestData_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 #include "platform/network/EncodedFormData.h" | 9 #include "platform/network/EncodedFormData.h" |
10 #include "platform/weborigin/KURL.h" | 10 #include "platform/weborigin/KURL.h" |
11 #include "platform/weborigin/Referrer.h" | 11 #include "platform/weborigin/Referrer.h" |
12 #include "platform/weborigin/ReferrerPolicy.h" | 12 #include "platform/weborigin/ReferrerPolicy.h" |
13 #include "public/platform/WebURLRequest.h" | 13 #include "public/platform/WebURLRequest.h" |
14 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" | 14 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" |
15 #include "wtf/PassOwnPtr.h" | 15 #include "wtf/PassOwnPtr.h" |
16 #include "wtf/PassRefPtr.h" | 16 #include "wtf/PassRefPtr.h" |
17 #include "wtf/text/AtomicString.h" | 17 #include "wtf/text/AtomicString.h" |
18 #include "wtf/text/WTFString.h" | 18 #include "wtf/text/WTFString.h" |
19 | 19 |
20 namespace blink { | 20 namespace blink { |
21 | 21 |
22 class BodyStreamBuffer; | 22 class BodyStreamBuffer; |
23 class ExecutionContext; | 23 class ExecutionContext; |
24 class FetchHeaderList; | 24 class FetchHeaderList; |
25 class PasswordCredential; | 25 class PasswordCredential; |
26 class SecurityOrigin; | 26 class SecurityOrigin; |
| 27 class ScriptState; |
27 class WebServiceWorkerRequest; | 28 class WebServiceWorkerRequest; |
28 | 29 |
29 class FetchRequestData final : public GarbageCollectedFinalized<FetchRequestData
> { | 30 class FetchRequestData final : public GarbageCollectedFinalized<FetchRequestData
> { |
30 WTF_MAKE_NONCOPYABLE(FetchRequestData); | 31 WTF_MAKE_NONCOPYABLE(FetchRequestData); |
31 public: | 32 public: |
32 enum Tainting { BasicTainting, CORSTainting, OpaqueTainting }; | 33 enum Tainting { BasicTainting, CORSTainting, OpaqueTainting }; |
33 | 34 |
34 static FetchRequestData* create(); | 35 static FetchRequestData* create(); |
35 static FetchRequestData* create(ExecutionContext*, const WebServiceWorkerReq
uest&); | 36 static FetchRequestData* create(ScriptState*, const WebServiceWorkerRequest&
); |
36 // Call Request::refreshBody() after calling clone() or pass(). | 37 // Call Request::refreshBody() after calling clone() or pass(). |
37 FetchRequestData* clone(ExecutionContext*); | 38 FetchRequestData* clone(ScriptState*); |
38 FetchRequestData* pass(ExecutionContext*); | 39 FetchRequestData* pass(ScriptState*); |
39 ~FetchRequestData(); | 40 ~FetchRequestData(); |
40 | 41 |
41 void setMethod(AtomicString method) { m_method = method; } | 42 void setMethod(AtomicString method) { m_method = method; } |
42 const AtomicString& method() const { return m_method; } | 43 const AtomicString& method() const { return m_method; } |
43 void setURL(const KURL& url) { m_url = url; } | 44 void setURL(const KURL& url) { m_url = url; } |
44 const KURL& url() const { return m_url; } | 45 const KURL& url() const { return m_url; } |
45 bool unsafeRequestFlag() const { return m_unsafeRequestFlag; } | 46 bool unsafeRequestFlag() const { return m_unsafeRequestFlag; } |
46 void setUnsafeRequestFlag(bool flag) { m_unsafeRequestFlag = flag; } | 47 void setUnsafeRequestFlag(bool flag) { m_unsafeRequestFlag = flag; } |
47 WebURLRequest::RequestContext context() const { return m_context; } | 48 WebURLRequest::RequestContext context() const { return m_context; } |
48 void setContext(WebURLRequest::RequestContext context) { m_context = context
; } | 49 void setContext(WebURLRequest::RequestContext context) { m_context = context
; } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Tainting m_responseTainting; | 111 Tainting m_responseTainting; |
111 Member<BodyStreamBuffer> m_buffer; | 112 Member<BodyStreamBuffer> m_buffer; |
112 String m_mimeType; | 113 String m_mimeType; |
113 String m_integrity; | 114 String m_integrity; |
114 RefPtr<EncodedFormData> m_attachedCredential; | 115 RefPtr<EncodedFormData> m_attachedCredential; |
115 }; | 116 }; |
116 | 117 |
117 } // namespace blink | 118 } // namespace blink |
118 | 119 |
119 #endif // FetchRequestData_h | 120 #endif // FetchRequestData_h |
OLD | NEW |