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 "modules/serviceworkers/FetchBodyStream.h" | 10 #include "modules/serviceworkers/FetchBodyStream.h" |
11 #include "modules/serviceworkers/FetchRequestData.h" | 11 #include "modules/serviceworkers/FetchRequestData.h" |
12 #include "modules/serviceworkers/Headers.h" | 12 #include "modules/serviceworkers/Headers.h" |
13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
14 #include "platform/weborigin/KURL.h" | 14 #include "platform/weborigin/KURL.h" |
15 #include "wtf/RefCounted.h" | |
16 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
17 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
18 | 17 |
19 namespace blink { | 18 namespace blink { |
20 | 19 |
21 class RequestInit; | 20 class RequestInit; |
22 struct ResourceLoaderOptions; | 21 struct ResourceLoaderOptions; |
23 class ResourceRequest; | 22 class ResourceRequest; |
24 struct ThreadableLoaderOptions; | 23 struct ThreadableLoaderOptions; |
25 class WebServiceWorkerRequest; | 24 class WebServiceWorkerRequest; |
26 | 25 |
27 class Request FINAL : public RefCountedWillBeGarbageCollected<Request>, public S
criptWrappable { | 26 class Request FINAL : public GarbageCollected<Request>, public ScriptWrappable { |
28 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Request); | |
29 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
30 public: | 28 public: |
31 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, const Strin
g&, ExceptionState&); | 29 static Request* create(ExecutionContext*, const String&, ExceptionState&); |
32 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, const Strin
g&, const Dictionary&, ExceptionState&); | 30 static Request* create(ExecutionContext*, const String&, const Dictionary&,
ExceptionState&); |
33 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, Request*, E
xceptionState&); | 31 static Request* create(ExecutionContext*, Request*, ExceptionState&); |
34 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, Request*, c
onst Dictionary&, ExceptionState&); | 32 static Request* create(ExecutionContext*, Request*, const Dictionary&, Excep
tionState&); |
35 static PassRefPtrWillBeRawPtr<Request> create(PassRefPtrWillBeRawPtr<FetchRe
questData>); | 33 static Request* create(FetchRequestData*); |
36 static PassRefPtrWillBeRawPtr<Request> create(const WebServiceWorkerRequest&
); | 34 static Request* create(const WebServiceWorkerRequest&); |
37 | 35 |
38 PassRefPtrWillBeRawPtr<FetchRequestData> request() { return m_request; } | 36 FetchRequestData* request() { return m_request; } |
39 | 37 |
40 String method() const; | 38 String method() const; |
41 String url() const; | 39 String url() const; |
42 PassRefPtrWillBeRawPtr<Headers> headers() const { return m_headers; } | 40 Headers* headers() const { return m_headers; } |
43 PassRefPtrWillBeRawPtr<FetchBodyStream> body(ExecutionContext*); | 41 FetchBodyStream* body(ExecutionContext*); |
44 String referrer() const; | 42 String referrer() const; |
45 String mode() const; | 43 String mode() const; |
46 String credentials() const; | 44 String credentials() const; |
47 | 45 |
48 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&); | 46 void populateWebServiceWorkerRequest(WebServiceWorkerRequest&); |
49 | 47 |
50 void setBodyBlobHandle(PassRefPtr<BlobDataHandle>); | 48 void setBodyBlobHandle(PassRefPtr<BlobDataHandle>); |
51 | 49 |
52 void trace(Visitor*); | 50 void trace(Visitor*); |
53 | 51 |
54 private: | 52 private: |
55 explicit Request(PassRefPtrWillBeRawPtr<FetchRequestData>); | 53 explicit Request(FetchRequestData*); |
56 explicit Request(const WebServiceWorkerRequest&); | 54 explicit Request(const WebServiceWorkerRequest&); |
57 | 55 |
58 RefPtrWillBeMember<FetchRequestData> m_request; | 56 Member<FetchRequestData> m_request; |
59 RefPtrWillBeMember<Headers> m_headers; | 57 Member<Headers> m_headers; |
60 RefPtrWillBeMember<FetchBodyStream> m_fetchBodyStream; | 58 Member<FetchBodyStream> m_fetchBodyStream; |
61 }; | 59 }; |
62 | 60 |
63 } // namespace blink | 61 } // namespace blink |
64 | 62 |
65 #endif // Request_h | 63 #endif // Request_h |
OLD | NEW |