Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: Source/modules/serviceworkers/Request.h

Issue 304053003: ServiceWorker: support Request.{url,method,origin,headers} [blink] (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/HeaderMap.cpp ('k') | Source/modules/serviceworkers/Request.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Request.h
diff --git a/Source/modules/serviceworkers/Response.h b/Source/modules/serviceworkers/Request.h
similarity index 36%
copy from Source/modules/serviceworkers/Response.h
copy to Source/modules/serviceworkers/Request.h
index 6932144b1b650c77f22d05d9c56c367bd468098d..c7c71d0c5d5d42b0da868b414922bc8af6496401 100644
--- a/Source/modules/serviceworkers/Response.h
+++ b/Source/modules/serviceworkers/Request.h
@@ -2,41 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef Response_h
-#define Response_h
+#ifndef Request_h
+#define Request_h
#include "bindings/v8/Dictionary.h"
#include "bindings/v8/ScriptWrappable.h"
#include "modules/serviceworkers/HeaderMap.h"
+#include "platform/weborigin/KURL.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
-namespace blink { class WebServiceWorkerResponse; }
+namespace blink { class WebServiceWorkerRequest; }
namespace WebCore {
-struct ResponseInit;
+struct RequestInit;
-class Response FINAL : public ScriptWrappable, public RefCounted<Response> {
+class Request FINAL : public ScriptWrappable, public RefCounted<Request> {
public:
- static PassRefPtr<Response> create();
- static PassRefPtr<Response> create(const Dictionary& responseInit);
- ~Response() { };
+ static PassRefPtr<Request> create();
+ static PassRefPtr<Request> create(const Dictionary&);
+ static PassRefPtr<Request> create(const blink::WebServiceWorkerRequest&);
+ ~Request() { };
- unsigned short status() const { return m_status; }
- String statusText() const { return m_statusText; }
- PassRefPtr<HeaderMap> headers() const;
+ void setURL(const String& value);
+ void setMethod(const String& value);
- void populateWebServiceWorkerResponse(blink::WebServiceWorkerResponse&);
+ String url() const { return m_url.string(); }
+ String method() const { return m_method; }
+ String origin() const;
+ PassRefPtr<HeaderMap> headers() const { return m_headers; }
private:
- explicit Response(const ResponseInit&);
- unsigned short m_status;
- String m_statusText;
+ explicit Request(const RequestInit&);
+ explicit Request(const blink::WebServiceWorkerRequest&);
+ KURL m_url;
+ String m_method;
RefPtr<HeaderMap> m_headers;
};
} // namespace WebCore
-#endif // Response_h
+#endif // Request_h
« no previous file with comments | « Source/modules/serviceworkers/HeaderMap.cpp ('k') | Source/modules/serviceworkers/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698