Chromium Code Reviews| 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/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
| 10 #include "platform/weborigin/Referrer.h" | 10 #include "platform/weborigin/Referrer.h" |
| 11 #include "platform/weborigin/ReferrerPolicy.h" | 11 #include "platform/weborigin/ReferrerPolicy.h" |
| 12 #include "public/platform/WebURLRequest.h" | 12 #include "public/platform/WebURLRequest.h" |
| 13 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" | 13 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" |
| 14 #include "wtf/PassOwnPtr.h" | 14 #include "wtf/PassOwnPtr.h" |
| 15 #include "wtf/PassRefPtr.h" | 15 #include "wtf/PassRefPtr.h" |
| 16 #include "wtf/text/AtomicString.h" | 16 #include "wtf/text/AtomicString.h" |
| 17 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 class BodyStreamBuffer; | 21 class BodyStreamBuffer; |
| 22 class ExecutionContext; | 22 class ExecutionContext; |
| 23 class FetchHeaderList; | 23 class FetchHeaderList; |
| 24 class PasswordCredential; | |
| 24 class SecurityOrigin; | 25 class SecurityOrigin; |
| 25 class WebServiceWorkerRequest; | 26 class WebServiceWorkerRequest; |
| 26 | 27 |
| 27 class FetchRequestData final : public GarbageCollectedFinalized<FetchRequestData > { | 28 class FetchRequestData final : public GarbageCollectedFinalized<FetchRequestData > { |
| 28 WTF_MAKE_NONCOPYABLE(FetchRequestData); | 29 WTF_MAKE_NONCOPYABLE(FetchRequestData); |
| 29 public: | 30 public: |
| 30 enum Tainting { BasicTainting, CORSTainting, OpaqueTainting }; | 31 enum Tainting { BasicTainting, CORSTainting, OpaqueTainting }; |
| 31 | 32 |
| 32 static FetchRequestData* create(); | 33 static FetchRequestData* create(); |
| 33 static FetchRequestData* create(ExecutionContext*, const WebServiceWorkerReq uest&); | 34 static FetchRequestData* create(ExecutionContext*, const WebServiceWorkerReq uest&); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 64 Tainting responseTainting() const { return m_responseTainting; } | 65 Tainting responseTainting() const { return m_responseTainting; } |
| 65 FetchHeaderList* headerList() const { return m_headerList.get(); } | 66 FetchHeaderList* headerList() const { return m_headerList.get(); } |
| 66 void setHeaderList(FetchHeaderList* headerList) { m_headerList = headerList; } | 67 void setHeaderList(FetchHeaderList* headerList) { m_headerList = headerList; } |
| 67 BodyStreamBuffer* buffer() const { return m_buffer; } | 68 BodyStreamBuffer* buffer() const { return m_buffer; } |
| 68 // Call Request::refreshBody() after calling setBuffer(). | 69 // Call Request::refreshBody() after calling setBuffer(). |
| 69 void setBuffer(BodyStreamBuffer* buffer) { m_buffer = buffer; } | 70 void setBuffer(BodyStreamBuffer* buffer) { m_buffer = buffer; } |
| 70 String mimeType() const { return m_mimeType; } | 71 String mimeType() const { return m_mimeType; } |
| 71 void setMIMEType(const String& type) { m_mimeType = type; } | 72 void setMIMEType(const String& type) { m_mimeType = type; } |
| 72 String integrity() const { return m_integrity; } | 73 String integrity() const { return m_integrity; } |
| 73 void setIntegrity(const String& integrity) { m_integrity = integrity; } | 74 void setIntegrity(const String& integrity) { m_integrity = integrity; } |
| 75 BodyStreamBuffer* attachedCredentialBuffer() const { return m_attachedCreden tialBuffer; } | |
| 76 void setAttachedCredentialBuffer(BodyStreamBuffer* buffer) { m_attachedCrede ntialBuffer = buffer; } | |
| 74 | 77 |
| 75 // We use these strings instead of "no-referrer" and "client" in the spec. | 78 // We use these strings instead of "no-referrer" and "client" in the spec. |
| 76 static AtomicString noReferrerString() { return AtomicString(); } | 79 static AtomicString noReferrerString() { return AtomicString(); } |
| 77 static AtomicString clientReferrerString() { return AtomicString("about:clie nt"); } | 80 static AtomicString clientReferrerString() { return AtomicString("about:clie nt"); } |
| 78 | 81 |
| 79 DECLARE_TRACE(); | 82 DECLARE_TRACE(); |
| 80 | 83 |
| 81 private: | 84 private: |
| 82 FetchRequestData(); | 85 FetchRequestData(); |
| 83 | 86 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 100 // FIXME: Support m_synchronousFlag; | 103 // FIXME: Support m_synchronousFlag; |
| 101 WebURLRequest::FetchRequestMode m_mode; | 104 WebURLRequest::FetchRequestMode m_mode; |
| 102 WebURLRequest::FetchCredentialsMode m_credentials; | 105 WebURLRequest::FetchCredentialsMode m_credentials; |
| 103 WebURLRequest::FetchRedirectMode m_redirect; | 106 WebURLRequest::FetchRedirectMode m_redirect; |
| 104 // FIXME: Support m_useURLCredentialsFlag; | 107 // FIXME: Support m_useURLCredentialsFlag; |
| 105 // FIXME: Support m_redirectCount; | 108 // FIXME: Support m_redirectCount; |
| 106 Tainting m_responseTainting; | 109 Tainting m_responseTainting; |
| 107 Member<BodyStreamBuffer> m_buffer; | 110 Member<BodyStreamBuffer> m_buffer; |
| 108 String m_mimeType; | 111 String m_mimeType; |
| 109 String m_integrity; | 112 String m_integrity; |
| 113 Member<BodyStreamBuffer> m_attachedCredentialBuffer; | |
|
horo
2016/04/05 07:24:35
BodyStreamBuffer is designed to be readable only o
| |
| 110 }; | 114 }; |
| 111 | 115 |
| 112 } // namespace blink | 116 } // namespace blink |
| 113 | 117 |
| 114 #endif // FetchRequestData_h | 118 #endif // FetchRequestData_h |
| OLD | NEW |