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

Side by Side Diff: Source/modules/serviceworkers/Response.h

Issue 307063002: ServiceWorker: Add a Response ctor that accepts the body as a Blob (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simpler Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Response_h
6 #define Response_h 6 #define Response_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 "wtf/RefCounted.h" 11 #include "wtf/RefCounted.h"
12 #include "wtf/RefPtr.h" 12 #include "wtf/RefPtr.h"
13 #include "wtf/text/WTFString.h" 13 #include "wtf/text/WTFString.h"
14 14
15 namespace blink { class WebServiceWorkerResponse; } 15 namespace blink { class WebServiceWorkerResponse; }
16 16
17 namespace WebCore { 17 namespace WebCore {
18 18
19 class Blob;
19 struct ResponseInit; 20 struct ResponseInit;
20 21
21 class Response FINAL : public ScriptWrappable, public RefCounted<Response> { 22 class Response FINAL : public ScriptWrappable, public RefCounted<Response> {
22 public: 23 public:
23 static PassRefPtr<Response> create();
24 static PassRefPtr<Response> create(const Dictionary& responseInit); 24 static PassRefPtr<Response> create(const Dictionary& responseInit);
25 static PassRefPtr<Response> create(Blob* body, const Dictionary& responseIni t);
25 ~Response() { }; 26 ~Response() { };
26 27
27 unsigned short status() const { return m_status; } 28 unsigned short status() const { return m_status; }
28 String statusText() const { return m_statusText; } 29 String statusText() const { return m_statusText; }
29 PassRefPtr<HeaderMap> headers() const; 30 PassRefPtr<HeaderMap> headers() const;
30 31
31 void populateWebServiceWorkerResponse(blink::WebServiceWorkerResponse&); 32 void populateWebServiceWorkerResponse(blink::WebServiceWorkerResponse&);
32 33
33 private: 34 private:
34 explicit Response(const ResponseInit&); 35 Response(const String& blobUUID, const ResponseInit&);
35 unsigned short m_status; 36 unsigned short m_status;
36 String m_statusText; 37 String m_statusText;
37 RefPtr<HeaderMap> m_headers; 38 RefPtr<HeaderMap> m_headers;
39 String m_blobUUID;
kinuko 2014/05/30 12:53:15 I think this should hold a reference to Blob (or,
michaeln1 2014/05/30 20:09:35 yup, the ctor probably should take as input a ptr
falken 2014/06/02 03:55:27 I see! Done.
38 }; 40 };
39 41
40 } // namespace WebCore 42 } // namespace WebCore
41 43
42 #endif // Response_h 44 #endif // Response_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698