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

Side by Side Diff: public/platform/WebServiceWorkerResponse.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: don't crash on null body 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
« no previous file with comments | « Source/platform/exported/WebServiceWorkerResponse.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebServiceWorkerResponse_h 5 #ifndef WebServiceWorkerResponse_h
6 #define WebServiceWorkerResponse_h 6 #define WebServiceWorkerResponse_h
7 7
8 #include "WebCommon.h" 8 #include "WebCommon.h"
9 #include "public/platform/WebPrivatePtr.h" 9 #include "public/platform/WebPrivatePtr.h"
10 #include "public/platform/WebString.h" 10 #include "public/platform/WebString.h"
11 #include "public/platform/WebVector.h" 11 #include "public/platform/WebVector.h"
12 12
13 #if INSIDE_BLINK 13 #if INSIDE_BLINK
14 #include "wtf/Forward.h" 14 #include "wtf/Forward.h"
15 #include "wtf/HashMap.h" 15 #include "wtf/HashMap.h"
16 #include "wtf/text/StringHash.h" 16 #include "wtf/text/StringHash.h"
17
18 namespace WebCore {
19 class BlobDataHandle;
20 }
17 #endif 21 #endif
18 22
19 // FIXME: Remove this after chromium code is cleaned up.
20 #define NEW_SERVICE_WORKER_RESPONSE_INTERFACE
21
22 namespace blink { 23 namespace blink {
23 24
24 class WebServiceWorkerResponsePrivate; 25 class WebServiceWorkerResponsePrivate;
25 26
26 // Represents a response to a fetch operation. ServiceWorker uses this to 27 // Represents a response to a fetch operation. ServiceWorker uses this to
27 // respond to a FetchEvent dispatched by the browser. The plan is for the Cache 28 // respond to a FetchEvent dispatched by the browser. The plan is for the Cache
28 // and fetch() API to also use it. 29 // and fetch() API to also use it.
29 class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse { 30 class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse {
30 public: 31 public:
31 ~WebServiceWorkerResponse() { reset(); } 32 ~WebServiceWorkerResponse() { reset(); }
(...skipping 10 matching lines...) Expand all
42 void setStatus(unsigned short); 43 void setStatus(unsigned short);
43 unsigned short status() const; 44 unsigned short status() const;
44 45
45 void setStatusText(const WebString&); 46 void setStatusText(const WebString&);
46 WebString statusText() const; 47 WebString statusText() const;
47 48
48 void setHeader(const WebString& key, const WebString& value); 49 void setHeader(const WebString& key, const WebString& value);
49 WebVector<WebString> getHeaderKeys() const; 50 WebVector<WebString> getHeaderKeys() const;
50 WebString getHeader(const WebString& key) const; 51 WebString getHeader(const WebString& key) const;
51 52
53 WebString blobUUID() const;
54
52 #if INSIDE_BLINK 55 #if INSIDE_BLINK
53 void setHeaders(const HashMap<String, String>&); 56 void setHeaders(const HashMap<String, String>&);
54 const HashMap<String, String>& headers() const; 57 const HashMap<String, String>& headers() const;
58
59 void setBlobDataHandle(PassRefPtr<WebCore::BlobDataHandle>);
60 PassRefPtr<WebCore::BlobDataHandle> blobDataHandle() const;
55 #endif 61 #endif
56 62
57 // FIXME: Eventually this should have additional methods such as for blob.
58
59 private: 63 private:
60 WebPrivatePtr<WebServiceWorkerResponsePrivate> m_private; 64 WebPrivatePtr<WebServiceWorkerResponsePrivate> m_private;
61 }; 65 };
62 66
63 } // namespace blink 67 } // namespace blink
64 68
65 #endif // WebServiceWorkerResponse_h 69 #endif // WebServiceWorkerResponse_h
OLDNEW
« no previous file with comments | « Source/platform/exported/WebServiceWorkerResponse.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698