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