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/v8/Dictionary.h" | 8 #include "bindings/v8/Dictionary.h" |
9 #include "bindings/v8/ScriptWrappable.h" | 9 #include "bindings/v8/ScriptWrappable.h" |
10 #include "modules/serviceworkers/HeaderMap.h" | 10 #include "modules/serviceworkers/HeaderMap.h" |
11 #include "platform/weborigin/KURL.h" | 11 #include "platform/weborigin/KURL.h" |
12 #include "wtf/RefCounted.h" | 12 #include "wtf/RefCounted.h" |
13 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
14 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
15 | 15 |
16 namespace blink { class WebServiceWorkerRequest; } | 16 namespace blink { class WebServiceWorkerRequest; } |
17 | 17 |
18 namespace WebCore { | 18 namespace WebCore { |
19 | 19 |
20 struct RequestInit; | 20 struct RequestInit; |
| 21 class ResourceRequest; |
21 | 22 |
22 class Request FINAL : public ScriptWrappable, public RefCounted<Request> { | 23 class Request FINAL : public ScriptWrappable, public RefCounted<Request> { |
23 public: | 24 public: |
24 static PassRefPtr<Request> create(); | 25 static PassRefPtr<Request> create(); |
25 static PassRefPtr<Request> create(const Dictionary&); | 26 static PassRefPtr<Request> create(const Dictionary&); |
26 static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&); | 27 static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&); |
27 ~Request() { }; | 28 ~Request() { }; |
28 | 29 |
29 void setURL(const String& value); | 30 void setURL(const String& value); |
30 void setMethod(const String& value); | 31 void setMethod(const String& value); |
31 | 32 |
32 String url() const { return m_url.string(); } | 33 String url() const { return m_url.string(); } |
33 String method() const { return m_method; } | 34 String method() const { return m_method; } |
34 String origin() const; | 35 String origin() const; |
35 PassRefPtr<HeaderMap> headers() const { return m_headers; } | 36 PassRefPtr<HeaderMap> headers() const { return m_headers; } |
36 | 37 |
| 38 PassOwnPtr<ResourceRequest> createResourceRequest() const; |
| 39 |
37 private: | 40 private: |
38 explicit Request(const RequestInit&); | 41 explicit Request(const RequestInit&); |
39 explicit Request(const blink::WebServiceWorkerRequest&); | 42 explicit Request(const blink::WebServiceWorkerRequest&); |
40 KURL m_url; | 43 KURL m_url; |
41 String m_method; | 44 String m_method; |
42 RefPtr<HeaderMap> m_headers; | 45 RefPtr<HeaderMap> m_headers; |
43 }; | 46 }; |
44 | 47 |
45 } // namespace WebCore | 48 } // namespace WebCore |
46 | 49 |
47 #endif // Request_h | 50 #endif // Request_h |
OLD | NEW |