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 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/WebURL.h" | 11 #include "public/platform/WebURL.h" |
12 #include "public/platform/WebVector.h" | 12 #include "public/platform/WebVector.h" |
13 | 13 |
14 #if INSIDE_BLINK | 14 #if INSIDE_BLINK |
15 #include "wtf/Forward.h" | 15 #include "wtf/Forward.h" |
16 #include "wtf/HashMap.h" | 16 #include "wtf/HashMap.h" |
17 #include "wtf/text/StringHash.h" | 17 #include "wtf/text/StringHash.h" |
18 | |
19 namespace blink { | |
20 class BlobDataHandle; | |
21 } | |
22 #endif | 18 #endif |
23 | 19 |
24 namespace blink { | 20 namespace blink { |
25 | 21 |
| 22 class BlobDataHandle; |
26 class WebServiceWorkerResponsePrivate; | 23 class WebServiceWorkerResponsePrivate; |
27 | 24 |
28 // Represents a response to a fetch operation. ServiceWorker uses this to | 25 // Represents a response to a fetch operation. ServiceWorker uses this to |
29 // respond to a FetchEvent dispatched by the browser. The plan is for the Cache | 26 // respond to a FetchEvent dispatched by the browser. The plan is for the Cache |
30 // and fetch() API to also use it. | 27 // and fetch() API to also use it. |
31 class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse { | 28 class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse { |
32 public: | 29 public: |
33 ~WebServiceWorkerResponse() { reset(); } | 30 ~WebServiceWorkerResponse() { reset(); } |
34 WebServiceWorkerResponse(); | 31 WebServiceWorkerResponse(); |
35 WebServiceWorkerResponse& operator=(const WebServiceWorkerResponse& other) | 32 WebServiceWorkerResponse& operator=(const WebServiceWorkerResponse& other) |
(...skipping 17 matching lines...) Expand all Loading... |
53 void setHeader(const WebString& key, const WebString& value); | 50 void setHeader(const WebString& key, const WebString& value); |
54 WebVector<WebString> getHeaderKeys() const; | 51 WebVector<WebString> getHeaderKeys() const; |
55 WebString getHeader(const WebString& key) const; | 52 WebString getHeader(const WebString& key) const; |
56 | 53 |
57 WebString blobUUID() const; | 54 WebString blobUUID() const; |
58 | 55 |
59 #if INSIDE_BLINK | 56 #if INSIDE_BLINK |
60 void setHeaders(const HashMap<String, String>&); | 57 void setHeaders(const HashMap<String, String>&); |
61 const HashMap<String, String>& headers() const; | 58 const HashMap<String, String>& headers() const; |
62 | 59 |
63 void setBlobDataHandle(PassRefPtr<blink::BlobDataHandle>); | 60 void setBlobDataHandle(PassRefPtr<BlobDataHandle>); |
64 PassRefPtr<blink::BlobDataHandle> blobDataHandle() const; | 61 PassRefPtr<BlobDataHandle> blobDataHandle() const; |
65 #endif | 62 #endif |
66 | 63 |
67 private: | 64 private: |
68 WebPrivatePtr<WebServiceWorkerResponsePrivate> m_private; | 65 WebPrivatePtr<WebServiceWorkerResponsePrivate> m_private; |
69 }; | 66 }; |
70 | 67 |
71 } // namespace blink | 68 } // namespace blink |
72 | 69 |
73 #endif // WebServiceWorkerResponse_h | 70 #endif // WebServiceWorkerResponse_h |
OLD | NEW |