| 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 "public/platform/WebCommon.h" | 8 #include "public/platform/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 #include "public/platform/WebURLRequest.h" | 13 #include "public/platform/WebURLRequest.h" |
| 14 | 14 |
| 15 #if INSIDE_BLINK | 15 #if INSIDE_BLINK |
| 16 #include <utility> |
| 16 #include "platform/network/HTTPHeaderMap.h" | 17 #include "platform/network/HTTPHeaderMap.h" |
| 17 #include "platform/weborigin/Referrer.h" | 18 #include "platform/weborigin/Referrer.h" |
| 18 #include "wtf/Forward.h" | 19 #include "wtf/Forward.h" |
| 19 #include "wtf/text/StringHash.h" | 20 #include "wtf/text/StringHash.h" |
| 20 #include <utility> | |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 namespace blink { | 23 namespace blink { |
| 24 | 24 |
| 25 class BlobDataHandle; | 25 class BlobDataHandle; |
| 26 class WebHTTPHeaderVisitor; | 26 class WebHTTPHeaderVisitor; |
| 27 class WebServiceWorkerRequestPrivate; | 27 class WebServiceWorkerRequestPrivate; |
| 28 | 28 |
| 29 // Represents a request for a web resource. | 29 // Represents a request for a web resource. |
| 30 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { | 30 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { |
| 31 public: | 31 public: |
| 32 ~WebServiceWorkerRequest() { reset(); } | 32 ~WebServiceWorkerRequest() { reset(); } |
| 33 WebServiceWorkerRequest(); | 33 WebServiceWorkerRequest(); |
| 34 WebServiceWorkerRequest(const WebServiceWorkerRequest& other) { | 34 WebServiceWorkerRequest(const WebServiceWorkerRequest& other) { |
| 35 assign(other); | 35 assign(other); |
| 36 } | 36 } |
| 37 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) { | 37 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) { |
| 38 assign(other); | 38 assign(other); |
| 39 return *this; | 39 return *this; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void reset(); | 42 void reset(); |
| 43 void assign(const WebServiceWorkerRequest&); | 43 void assign(const WebServiceWorkerRequest&); |
| 44 | 44 |
| 45 void setURL(const WebURL&); | 45 void setURL(const WebURL&); |
| 46 WebURL url() const; | 46 const WebURL& url() const; |
| 47 | 47 |
| 48 void setMethod(const WebString&); | 48 void setMethod(const WebString&); |
| 49 WebString method() const; | 49 const WebString& method() const; |
| 50 | 50 |
| 51 void setHeader(const WebString& key, const WebString& value); | 51 void setHeader(const WebString& key, const WebString& value); |
| 52 | 52 |
| 53 // If the key already exists, the value is appended to the existing value | 53 // If the key already exists, the value is appended to the existing value |
| 54 // with a comma delimiter between them. | 54 // with a comma delimiter between them. |
| 55 void appendHeader(const WebString& key, const WebString& value); | 55 void appendHeader(const WebString& key, const WebString& value); |
| 56 | 56 |
| 57 void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const; | 57 void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const; |
| 58 | 58 |
| 59 void setBlob(const WebString& uuid, long long size); | 59 void setBlob(const WebString& uuid, long long size); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 74 void setRedirectMode(WebURLRequest::FetchRedirectMode); | 74 void setRedirectMode(WebURLRequest::FetchRedirectMode); |
| 75 WebURLRequest::FetchRedirectMode redirectMode() const; | 75 WebURLRequest::FetchRedirectMode redirectMode() const; |
| 76 | 76 |
| 77 void setRequestContext(WebURLRequest::RequestContext); | 77 void setRequestContext(WebURLRequest::RequestContext); |
| 78 WebURLRequest::RequestContext requestContext() const; | 78 WebURLRequest::RequestContext requestContext() const; |
| 79 | 79 |
| 80 void setFrameType(WebURLRequest::FrameType); | 80 void setFrameType(WebURLRequest::FrameType); |
| 81 WebURLRequest::FrameType frameType() const; | 81 WebURLRequest::FrameType frameType() const; |
| 82 | 82 |
| 83 void setClientId(const WebString&); | 83 void setClientId(const WebString&); |
| 84 WebString clientId() const; | 84 const WebString& clientId() const; |
| 85 | 85 |
| 86 void setIsReload(bool); | 86 void setIsReload(bool); |
| 87 bool isReload() const; | 87 bool isReload() const; |
| 88 | 88 |
| 89 #if INSIDE_BLINK | 89 #if INSIDE_BLINK |
| 90 const HTTPHeaderMap& headers() const; | 90 const HTTPHeaderMap& headers() const; |
| 91 PassRefPtr<BlobDataHandle> blobDataHandle() const; | 91 PassRefPtr<BlobDataHandle> blobDataHandle() const; |
| 92 const Referrer& referrer() const; | 92 const Referrer& referrer() const; |
| 93 #endif | 93 #endif |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; | 96 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| 100 | 100 |
| 101 #endif // WebServiceWorkerRequest_h | 101 #endif // WebServiceWorkerRequest_h |
| OLD | NEW |