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" |
(...skipping 22 matching lines...) Expand all Loading... |
33 public: | 33 public: |
34 ~Request() override {} | 34 ~Request() override {} |
35 | 35 |
36 // From Request.idl: | 36 // From Request.idl: |
37 static Request* create(ScriptState*, const RequestInfo&, const Dictionary&,
ExceptionState&); | 37 static Request* create(ScriptState*, const RequestInfo&, const Dictionary&,
ExceptionState&); |
38 | 38 |
39 static Request* create(ScriptState*, const String&, ExceptionState&); | 39 static Request* create(ScriptState*, const String&, ExceptionState&); |
40 static Request* create(ScriptState*, const String&, const Dictionary&, Excep
tionState&); | 40 static Request* create(ScriptState*, const String&, const Dictionary&, Excep
tionState&); |
41 static Request* create(ScriptState*, Request*, ExceptionState&); | 41 static Request* create(ScriptState*, Request*, ExceptionState&); |
42 static Request* create(ScriptState*, Request*, const Dictionary&, ExceptionS
tate&); | 42 static Request* create(ScriptState*, Request*, const Dictionary&, ExceptionS
tate&); |
43 static Request* create(ExecutionContext*, FetchRequestData*); | 43 static Request* create(ScriptState*, FetchRequestData*); |
44 static Request* create(ExecutionContext*, const WebServiceWorkerRequest&); | 44 static Request* create(ScriptState*, const WebServiceWorkerRequest&); |
45 | 45 |
46 // From Request.idl: | 46 // From Request.idl: |
47 String method() const; | 47 String method() const; |
48 KURL url() const; | 48 KURL url() const; |
49 Headers* getHeaders() const { return m_headers; } | 49 Headers* getHeaders() const { return m_headers; } |
50 String context() const; | 50 String context() const; |
51 String referrer() const; | 51 String referrer() const; |
52 String referrerPolicy() const; | 52 String referrerPolicy() const; |
53 String mode() const; | 53 String mode() const; |
54 String credentials() const; | 54 String credentials() const; |
55 String redirect() const; | 55 String redirect() const; |
56 String integrity() const; | 56 String integrity() const; |
57 | 57 |
58 // From Request.idl: | 58 // From Request.idl: |
59 Request* clone(ExceptionState&); | 59 Request* clone(ScriptState*, ExceptionState&); |
60 | 60 |
61 FetchRequestData* passRequestData(); | 61 FetchRequestData* passRequestData(ScriptState*); |
62 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const; | 62 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&) const; |
63 bool hasBody() const; | 63 bool hasBody() const; |
64 BodyStreamBuffer* bodyBuffer() override { return m_request->buffer(); } | 64 BodyStreamBuffer* bodyBuffer() override { return m_request->buffer(); } |
65 const BodyStreamBuffer* bodyBuffer() const override { return m_request->buff
er(); } | 65 const BodyStreamBuffer* bodyBuffer() const override { return m_request->buff
er(); } |
66 PassRefPtr<EncodedFormData> attachedCredential() const { return m_request->a
ttachedCredential(); } | 66 PassRefPtr<EncodedFormData> attachedCredential() const { return m_request->a
ttachedCredential(); } |
67 | 67 |
68 void stop() override; | |
69 | |
70 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
71 | 69 |
72 private: | 70 private: |
73 Request(ExecutionContext*, FetchRequestData*); | 71 Request(ScriptState*, FetchRequestData*, Headers*); |
74 Request(ExecutionContext*, const WebServiceWorkerRequest&); | 72 Request(ScriptState*, FetchRequestData*); |
75 Request(ExecutionContext*, FetchRequestData*, Headers*); | 73 Request(ScriptState*, const WebServiceWorkerRequest&); |
76 | 74 |
77 const FetchRequestData* request() const { return m_request; } | 75 const FetchRequestData* request() const { return m_request; } |
78 static Request* createRequestWithRequestOrString(ScriptState*, Request*, con
st String&, RequestInit&, ExceptionState&); | 76 static Request* createRequestWithRequestOrString(ScriptState*, Request*, con
st String&, RequestInit&, ExceptionState&); |
79 | 77 |
80 String mimeType() const override; | 78 String mimeType() const override; |
81 | 79 |
82 const Member<FetchRequestData> m_request; | 80 const Member<FetchRequestData> m_request; |
83 const Member<Headers> m_headers; | 81 const Member<Headers> m_headers; |
84 }; | 82 }; |
85 | 83 |
86 } // namespace blink | 84 } // namespace blink |
87 | 85 |
88 #endif // Request_h | 86 #endif // Request_h |
OLD | NEW |