| 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 WebServiceWorkerRequest_h | 5 #ifndef WebServiceWorkerRequest_h |
| 6 #define WebServiceWorkerRequest_h | 6 #define WebServiceWorkerRequest_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/WebReferrerPolicy.h" | 10 #include "public/platform/WebReferrerPolicy.h" |
| 11 #include "public/platform/WebString.h" | 11 #include "public/platform/WebString.h" |
| 12 #include "public/platform/WebURL.h" | 12 #include "public/platform/WebURL.h" |
| 13 | 13 |
| 14 #if INSIDE_BLINK | 14 #if INSIDE_BLINK |
| 15 #include "platform/network/HTTPHeaderMap.h" | 15 #include "platform/network/HTTPHeaderMap.h" |
| 16 #include "platform/weborigin/Referrer.h" | 16 #include "platform/weborigin/Referrer.h" |
| 17 #include "wtf/Forward.h" | 17 #include "wtf/Forward.h" |
| 18 #include "wtf/text/StringHash.h" | 18 #include "wtf/text/StringHash.h" |
| 19 #include <utility> | 19 #include <utility> |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 | 23 |
| 24 class BlobDataHandle; |
| 24 class WebServiceWorkerRequestPrivate; | 25 class WebServiceWorkerRequestPrivate; |
| 25 | 26 |
| 26 // Represents a request of a fetch operation. FetchEvent dispatched by the | 27 // Represents a request of a fetch operation. FetchEvent dispatched by the |
| 27 // browser contains this. The plan is for the Cache and fetch() API to also use | 28 // browser contains this. The plan is for the Cache and fetch() API to also use |
| 28 // it. | 29 // it. |
| 29 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { | 30 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { |
| 30 public: | 31 public: |
| 31 ~WebServiceWorkerRequest() { reset(); } | 32 ~WebServiceWorkerRequest() { reset(); } |
| 32 WebServiceWorkerRequest(); | 33 WebServiceWorkerRequest(); |
| 33 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) | 34 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) |
| 34 { | 35 { |
| 35 assign(other); | 36 assign(other); |
| 36 return *this; | 37 return *this; |
| 37 } | 38 } |
| 38 | 39 |
| 39 void reset(); | 40 void reset(); |
| 40 void assign(const WebServiceWorkerRequest&); | 41 void assign(const WebServiceWorkerRequest&); |
| 41 | 42 |
| 42 void setURL(const WebURL&); | 43 void setURL(const WebURL&); |
| 43 WebURL url() const; | 44 WebURL url() const; |
| 44 | 45 |
| 45 void setMethod(const WebString&); | 46 void setMethod(const WebString&); |
| 46 WebString method() const; | 47 WebString method() const; |
| 47 | 48 |
| 48 void setHeader(const WebString& key, const WebString& value); | 49 void setHeader(const WebString& key, const WebString& value); |
| 49 | 50 |
| 51 void setBlob(const WebString& uuid, long long size); |
| 52 |
| 50 void setReferrer(const WebString&, WebReferrerPolicy); | 53 void setReferrer(const WebString&, WebReferrerPolicy); |
| 51 | 54 |
| 52 void setIsReload(bool); | 55 void setIsReload(bool); |
| 53 bool isReload() const; | 56 bool isReload() const; |
| 54 | 57 |
| 55 #if INSIDE_BLINK | 58 #if INSIDE_BLINK |
| 56 const HTTPHeaderMap& headers() const; | 59 const HTTPHeaderMap& headers() const; |
| 60 PassRefPtr<BlobDataHandle> blobDataHandle() const; |
| 57 const Referrer& referrer() const; | 61 const Referrer& referrer() const; |
| 58 #endif | 62 #endif |
| 59 | 63 |
| 60 private: | 64 private: |
| 61 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; | 65 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 } // namespace blink | 68 } // namespace blink |
| 65 | 69 |
| 66 #endif // WebServiceWorkerRequest_h | 70 #endif // WebServiceWorkerRequest_h |
| OLD | NEW |