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

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

Issue 373613004: [ServiceWorker] Make Response class better conformance with the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 5 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
Index: Source/modules/serviceworkers/Response.h
diff --git a/Source/modules/serviceworkers/Response.h b/Source/modules/serviceworkers/Response.h
index 6a28a19423dcb8c37ee55e72664fcd1af49eb058..ba41b63718f3c3c587f267cd33d58e1c4cac4588 100644
--- a/Source/modules/serviceworkers/Response.h
+++ b/Source/modules/serviceworkers/Response.h
@@ -7,7 +7,8 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ScriptWrappable.h"
-#include "modules/serviceworkers/HeaderMap.h"
+#include "modules/serviceworkers/FetchResponseData.h"
+#include "modules/serviceworkers/Headers.h"
#include "platform/blob/BlobData.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
@@ -18,30 +19,32 @@ namespace blink { class WebServiceWorkerResponse; }
namespace WebCore {
class Blob;
+class ExceptionState;
struct ResponseInit;
-class Response FINAL : public ScriptWrappable, public RefCounted<Response> {
+class Response FINAL : public RefCounted<Response>, public ScriptWrappable {
public:
- static PassRefPtr<Response> create(Blob*, const Dictionary&);
- static PassRefPtr<Response> create(Blob*, const ResponseInit&);
- ~Response() { };
-
- unsigned short status() const { return m_status; }
- void setStatus(unsigned short value) { m_status = value; }
+ static PassRefPtr<Response> create(Blob*, const Dictionary&, ExceptionState&);
+ static PassRefPtr<Response> create(Blob*, const ResponseInit&, ExceptionState&);
- String statusText() const { return m_statusText; }
- void setStatusText(const String& value) { m_statusText = value; }
+ static PassRefPtr<Response> create(PassRefPtr<FetchResponseData>);
+ ~Response() { };
- PassRefPtr<HeaderMap> headers() const;
+ String type() const;
+ String url() const;
+ unsigned short status() const;
+ String statusText() const;
+ PassRefPtr<Headers> headers() const;
void populateWebServiceWorkerResponse(blink::WebServiceWorkerResponse&);
private:
- Response(PassRefPtr<BlobDataHandle>, const ResponseInit&);
- unsigned short m_status;
- String m_statusText;
- RefPtr<HeaderMap> m_headers;
- RefPtr<BlobDataHandle> m_blobDataHandle;
+ Response();
+ Response(PassRefPtr<FetchResponseData>);
+
+ RefPtr<FetchResponseData> m_response;
+ RefPtr<Headers> m_headers;
+ // FIXME: Support FetchBodyStream.
};
} // namespace WebCore
« no previous file with comments | « Source/modules/serviceworkers/HeaderMapForEachCallback.idl ('k') | Source/modules/serviceworkers/Response.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698