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/HeaderMap.h" | 10 #include "modules/serviceworkers/FetchRequestData.h" |
11 #include "modules/serviceworkers/Headers.h" | |
11 #include "platform/weborigin/KURL.h" | 12 #include "platform/weborigin/KURL.h" |
12 #include "wtf/RefCounted.h" | 13 #include "wtf/RefCounted.h" |
13 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
14 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
15 | 16 |
16 namespace blink { class WebServiceWorkerRequest; } | 17 namespace blink { class WebServiceWorkerRequest; } |
17 | 18 |
18 namespace WebCore { | 19 namespace WebCore { |
19 | 20 |
20 struct RequestInit; | 21 struct RequestInit; |
21 class ResourceRequest; | 22 class ResourceRequest; |
23 struct ResourceLoaderOptions; | |
24 struct ThreadableLoaderOptions; | |
22 | 25 |
23 class Request FINAL : public ScriptWrappable, public RefCounted<Request> { | 26 class Request FINAL : public ScriptWrappable, public RefCounted<Request> { |
24 public: | 27 public: |
25 static PassRefPtr<Request> create(); | 28 static PassRefPtr<Request> create(ExecutionContext*, const String&, Exceptio nState&); |
26 static PassRefPtr<Request> create(const Dictionary&); | 29 static PassRefPtr<Request> create(ExecutionContext*, const String&, const Di ctionary&, ExceptionState&); |
30 static PassRefPtr<Request> create(ExecutionContext*, Request*, ExceptionStat e&); | |
31 static PassRefPtr<Request> create(ExecutionContext*, Request*, const Diction ary&, ExceptionState&); | |
32 | |
33 static PassRefPtr<Request> create(PassRefPtr<FetchRequestData>); | |
34 | |
27 static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&); | 35 static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&); |
36 | |
28 ~Request() { }; | 37 ~Request() { }; |
29 | 38 |
30 void setURL(const String& value); | 39 PassRefPtr<FetchRequestData> request() { return m_request; } |
31 void setMethod(const String& value); | |
32 | 40 |
33 String url() const { return m_url.string(); } | 41 String method() const; |
34 String method() const { return m_method; } | 42 String url() const; |
35 String origin() const; | 43 PassRefPtr<Headers> headers() const { return m_headers; } |
36 PassRefPtr<HeaderMap> headers() const { return m_headers; } | 44 // FIXME: Support body. |
45 String referrer() const; | |
46 String mode() const; | |
47 String credentials() const; | |
37 | 48 |
38 PassOwnPtr<ResourceRequest> createResourceRequest() const; | 49 PassOwnPtr<ResourceRequest> createResourceRequest() const; |
39 | 50 |
40 private: | 51 private: |
41 explicit Request(const RequestInit&); | 52 explicit Request(PassRefPtr<FetchRequestData>); |
42 explicit Request(const blink::WebServiceWorkerRequest&); | 53 explicit Request(const blink::WebServiceWorkerRequest&); |
43 KURL m_url; | 54 |
44 String m_method; | 55 RefPtr<FetchRequestData> m_request; |
45 RefPtr<HeaderMap> m_headers; | 56 RefPtr<Headers> m_headers; |
57 | |
falken
2014/07/04 10:05:01
nit: extra newline
horo
2014/07/04 10:29:28
Done.
| |
46 }; | 58 }; |
47 | 59 |
48 } // namespace WebCore | 60 } // namespace WebCore |
49 | 61 |
50 #endif // Request_h | 62 #endif // Request_h |
OLD | NEW |