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 public: | 27 public: |
30 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, const Strin
g&, ExceptionState&); | 28 static Request* create(ExecutionContext*, const String&, ExceptionState&); |
31 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, const Strin
g&, const Dictionary&, ExceptionState&); | 29 static Request* create(ExecutionContext*, const String&, const Dictionary&,
ExceptionState&); |
32 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, Request*, E
xceptionState&); | 30 static Request* create(ExecutionContext*, Request*, ExceptionState&); |
33 static PassRefPtrWillBeRawPtr<Request> create(ExecutionContext*, Request*, c
onst Dictionary&, ExceptionState&); | 31 static Request* create(ExecutionContext*, Request*, const Dictionary&, Excep
tionState&); |
34 | 32 |
35 static PassRefPtrWillBeRawPtr<Request> create(PassRefPtrWillBeRawPtr<FetchRe
questData>); | 33 static Request* create(FetchRequestData*); |
36 | 34 |
37 static PassRefPtrWillBeRawPtr<Request> create(const WebServiceWorkerRequest&
); | 35 static Request* create(const WebServiceWorkerRequest&); |
38 | 36 |
39 PassRefPtrWillBeRawPtr<FetchRequestData> request() { return m_request; } | 37 FetchRequestData* request() { return m_request; } |
40 | 38 |
41 String method() const; | 39 String method() const; |
42 String url() const; | 40 String url() const; |
43 PassRefPtrWillBeRawPtr<Headers> headers() const { return m_headers; } | 41 Headers* headers() const { return m_headers; } |
44 PassRefPtrWillBeRawPtr<FetchBodyStream> body(ExecutionContext*); | 42 FetchBodyStream* body(ExecutionContext*); |
45 String referrer() const; | 43 String referrer() const; |
46 String mode() const; | 44 String mode() const; |
47 String credentials() const; | 45 String credentials() const; |
48 | 46 |
49 void trace(Visitor*); | 47 void trace(Visitor*); |
50 | 48 |
51 private: | 49 private: |
52 explicit Request(PassRefPtrWillBeRawPtr<FetchRequestData>); | 50 explicit Request(FetchRequestData*); |
53 explicit Request(const WebServiceWorkerRequest&); | 51 explicit Request(const WebServiceWorkerRequest&); |
54 | 52 |
55 RefPtrWillBeMember<FetchRequestData> m_request; | 53 Member<FetchRequestData> m_request; |
56 RefPtrWillBeMember<Headers> m_headers; | 54 Member<Headers> m_headers; |
57 RefPtrWillBeMember<FetchBodyStream> m_fetchBodyStream; | 55 Member<FetchBodyStream> m_fetchBodyStream; |
58 }; | 56 }; |
59 | 57 |
60 } // namespace blink | 58 } // namespace blink |
61 | 59 |
62 #endif // Request_h | 60 #endif // Request_h |
OLD | NEW |