| 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 Response_h | 5 #ifndef Request_h |
| 6 #define Response_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 "wtf/RefCounted.h" | 12 #include "wtf/RefCounted.h" |
| 12 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
| 13 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
| 14 | 15 |
| 15 namespace blink { class WebServiceWorkerResponse; } | 16 namespace blink { class WebServiceWorkerRequest; } |
| 16 | 17 |
| 17 namespace WebCore { | 18 namespace WebCore { |
| 18 | 19 |
| 19 struct ResponseInit; | 20 struct RequestInit; |
| 20 | 21 |
| 21 class Response FINAL : public ScriptWrappable, public RefCounted<Response> { | 22 class Request FINAL : public ScriptWrappable, public RefCounted<Request> { |
| 22 public: | 23 public: |
| 23 static PassRefPtr<Response> create(); | 24 static PassRefPtr<Request> create(); |
| 24 static PassRefPtr<Response> create(const Dictionary& responseInit); | 25 static PassRefPtr<Request> create(const Dictionary&); |
| 25 ~Response() { }; | 26 static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&); |
| 27 ~Request() { }; |
| 26 | 28 |
| 27 unsigned short status() const { return m_status; } | 29 void setURL(const String& value); |
| 28 String statusText() const { return m_statusText; } | 30 void setMethod(const String& value); |
| 29 PassRefPtr<HeaderMap> headers() const; | |
| 30 | 31 |
| 31 void populateWebServiceWorkerResponse(blink::WebServiceWorkerResponse&); | 32 String url() const { return m_url.string(); } |
| 33 String method() const { return m_method; } |
| 34 String origin() const; |
| 35 PassRefPtr<HeaderMap> headers() const { return m_headers; } |
| 32 | 36 |
| 33 private: | 37 private: |
| 34 explicit Response(const ResponseInit&); | 38 explicit Request(const RequestInit&); |
| 35 unsigned short m_status; | 39 explicit Request(const blink::WebServiceWorkerRequest&); |
| 36 String m_statusText; | 40 KURL m_url; |
| 41 String m_method; |
| 37 RefPtr<HeaderMap> m_headers; | 42 RefPtr<HeaderMap> m_headers; |
| 38 }; | 43 }; |
| 39 | 44 |
| 40 } // namespace WebCore | 45 } // namespace WebCore |
| 41 | 46 |
| 42 #endif // Response_h | 47 #endif // Request_h |
| OLD | NEW |