| 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 Request_h | 5 #ifndef Request_h |
| 6 #define Request_h | 6 #define Request_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "bindings/modules/v8/UnionTypesModules.h" | 10 #include "bindings/modules/v8/UnionTypesModules.h" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/fetch/Body.h" | 12 #include "modules/fetch/Body.h" |
| 13 #include "modules/fetch/FetchRequestData.h" | 13 #include "modules/fetch/FetchRequestData.h" |
| 14 #include "modules/fetch/Headers.h" | 14 #include "modules/fetch/Headers.h" |
| 15 #include "platform/heap/Handle.h" | 15 #include "platform/heap/Handle.h" |
| 16 #include "platform/network/EncodedFormData.h" |
| 16 #include "platform/weborigin/KURL.h" | 17 #include "platform/weborigin/KURL.h" |
| 17 #include "public/platform/WebURLRequest.h" | 18 #include "public/platform/WebURLRequest.h" |
| 18 #include "wtf/text/WTFString.h" | 19 #include "wtf/text/WTFString.h" |
| 19 | 20 |
| 20 namespace blink { | 21 namespace blink { |
| 21 | 22 |
| 22 class BodyStreamBuffer; | 23 class BodyStreamBuffer; |
| 24 class EncodedFormData; |
| 23 class RequestInit; | 25 class RequestInit; |
| 24 class WebServiceWorkerRequest; | 26 class WebServiceWorkerRequest; |
| 25 | 27 |
| 26 using RequestInfo = RequestOrUSVString; | 28 using RequestInfo = RequestOrUSVString; |
| 27 | 29 |
| 28 class MODULES_EXPORT Request final : public Body { | 30 class MODULES_EXPORT Request final : public Body { |
| 29 DEFINE_WRAPPERTYPEINFO(); | 31 DEFINE_WRAPPERTYPEINFO(); |
| 30 WTF_MAKE_NONCOPYABLE(Request); | 32 WTF_MAKE_NONCOPYABLE(Request); |
| 31 public: | 33 public: |
| 32 ~Request() override {} | 34 ~Request() override {} |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 String integrity() const; | 55 String integrity() const; |
| 54 | 56 |
| 55 // From Request.idl: | 57 // From Request.idl: |
| 56 Request* clone(ExceptionState&); | 58 Request* clone(ExceptionState&); |
| 57 | 59 |
| 58 FetchRequestData* passRequestData(); | 60 FetchRequestData* passRequestData(); |
| 59 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const; | 61 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const; |
| 60 bool hasBody() const; | 62 bool hasBody() const; |
| 61 BodyStreamBuffer* bodyBuffer() override { return m_request->buffer(); } | 63 BodyStreamBuffer* bodyBuffer() override { return m_request->buffer(); } |
| 62 const BodyStreamBuffer* bodyBuffer() const override { return m_request->buff
er(); } | 64 const BodyStreamBuffer* bodyBuffer() const override { return m_request->buff
er(); } |
| 65 PassRefPtr<EncodedFormData> attachedCredential() const { return m_request->a
ttachedCredential(); } |
| 63 | 66 |
| 64 void stop() override; | 67 void stop() override; |
| 65 | 68 |
| 66 DECLARE_VIRTUAL_TRACE(); | 69 DECLARE_VIRTUAL_TRACE(); |
| 67 | 70 |
| 68 private: | 71 private: |
| 69 Request(ExecutionContext*, FetchRequestData*); | 72 Request(ExecutionContext*, FetchRequestData*); |
| 70 Request(ExecutionContext*, const WebServiceWorkerRequest&); | 73 Request(ExecutionContext*, const WebServiceWorkerRequest&); |
| 71 Request(ExecutionContext*, FetchRequestData*, Headers*); | 74 Request(ExecutionContext*, FetchRequestData*, Headers*); |
| 72 | 75 |
| 73 const FetchRequestData* request() const { return m_request; } | 76 const FetchRequestData* request() const { return m_request; } |
| 74 static Request* createRequestWithRequestOrString(ScriptState*, Request*, con
st String&, RequestInit&, ExceptionState&); | 77 static Request* createRequestWithRequestOrString(ScriptState*, Request*, con
st String&, RequestInit&, ExceptionState&); |
| 75 | 78 |
| 76 String mimeType() const override; | 79 String mimeType() const override; |
| 77 | 80 |
| 78 const Member<FetchRequestData> m_request; | 81 const Member<FetchRequestData> m_request; |
| 79 const Member<Headers> m_headers; | 82 const Member<Headers> m_headers; |
| 80 }; | 83 }; |
| 81 | 84 |
| 82 } // namespace blink | 85 } // namespace blink |
| 83 | 86 |
| 84 #endif // Request_h | 87 #endif // Request_h |
| OLD | NEW |