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

Side by Side Diff: public/platform/WebServiceWorkerRequest.h

Issue 433793002: Introducing the WebServiceWorkerCache. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase, some changes pulled out Created 6 years, 3 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 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 BlobDataHandle;
25 class WebHTTPHeaderVisitor;
25 class WebServiceWorkerRequestPrivate; 26 class WebServiceWorkerRequestPrivate;
26 27
27 // Represents a request of a fetch operation. FetchEvent dispatched by the 28 // Represents a request of a fetch operation. FetchEvent dispatched by the
28 // browser contains this. The plan is for the Cache and fetch() API to also use 29 // browser contains this. The plan is for the Cache and fetch() API to also use
29 // it. 30 // it.
30 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { 31 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest {
31 public: 32 public:
32 ~WebServiceWorkerRequest() { reset(); } 33 ~WebServiceWorkerRequest() { reset(); }
33 WebServiceWorkerRequest(); 34 WebServiceWorkerRequest();
35 WebServiceWorkerRequest(const WebServiceWorkerRequest& other) { assign(other ); }
34 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) 36 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other)
35 { 37 {
36 assign(other); 38 assign(other);
37 return *this; 39 return *this;
38 } 40 }
39 41
40 void reset(); 42 void reset();
41 void assign(const WebServiceWorkerRequest&); 43 void assign(const WebServiceWorkerRequest&);
42 44
43 void setURL(const WebURL&); 45 void setURL(const WebURL&);
44 WebURL url() const; 46 WebURL url() const;
45 47
46 void setMethod(const WebString&); 48 void setMethod(const WebString&);
47 WebString method() const; 49 WebString method() const;
48 50
49 void setHeader(const WebString& key, const WebString& value); 51 void setHeader(const WebString& key, const WebString& value);
52 void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const;
50 53
51 void setBlob(const WebString& uuid, long long size); 54 void setBlob(const WebString& uuid, long long size);
52 55
53 void setReferrer(const WebString&, WebReferrerPolicy); 56 void setReferrer(const WebString&, WebReferrerPolicy);
57 WebURL referrerUrl() const;
54 58
55 void setIsReload(bool); 59 void setIsReload(bool);
56 bool isReload() const; 60 bool isReload() const;
57 61
58 #if INSIDE_BLINK 62 #if INSIDE_BLINK
59 const HTTPHeaderMap& headers() const; 63 const HTTPHeaderMap& headers() const;
60 PassRefPtr<BlobDataHandle> blobDataHandle() const; 64 PassRefPtr<BlobDataHandle> blobDataHandle() const;
61 const Referrer& referrer() const; 65 const Referrer& referrer() const;
62 #endif 66 #endif
63 67
64 private: 68 private:
65 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; 69 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private;
66 }; 70 };
67 71
68 } // namespace blink 72 } // namespace blink
69 73
70 #endif // WebServiceWorkerRequest_h 74 #endif // WebServiceWorkerRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698