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

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

Issue 516123004: Support ServiceWorker created request objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@minimaster
Patch Set: fix more builds 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
« no previous file with comments | « Source/platform/network/HTTPHeaderMap.h ('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 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 for a web resource.
28 // browser contains this. The plan is for the Cache and fetch() API to also use
29 // it.
30 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest { 29 class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest {
31 public: 30 public:
32 ~WebServiceWorkerRequest() { reset(); } 31 ~WebServiceWorkerRequest() { reset(); }
33 WebServiceWorkerRequest(); 32 WebServiceWorkerRequest();
33 WebServiceWorkerRequest(const WebServiceWorkerRequest& other) { assign(other ); }
34 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other) 34 WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other)
35 { 35 {
36 assign(other); 36 assign(other);
37 return *this; 37 return *this;
38 } 38 }
39 39
40 void reset(); 40 void reset();
41 void assign(const WebServiceWorkerRequest&); 41 void assign(const WebServiceWorkerRequest&);
42 42
43 void setURL(const WebURL&); 43 void setURL(const WebURL&);
44 WebURL url() const; 44 WebURL url() const;
45 45
46 void setMethod(const WebString&); 46 void setMethod(const WebString&);
47 WebString method() const; 47 WebString method() const;
48 48
49 void setHeader(const WebString& key, const WebString& value); 49 void setHeader(const WebString& key, const WebString& value);
50 void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const;
50 51
51 void setBlob(const WebString& uuid, long long size); 52 void setBlob(const WebString& uuid, long long size);
52 53
53 void setReferrer(const WebString&, WebReferrerPolicy); 54 void setReferrer(const WebString&, WebReferrerPolicy);
55 WebURL referrerUrl() const;
56 WebReferrerPolicy referrerPolicy() const;
54 57
55 void setIsReload(bool); 58 void setIsReload(bool);
56 bool isReload() const; 59 bool isReload() const;
57 60
58 #if INSIDE_BLINK 61 #if INSIDE_BLINK
59 const HTTPHeaderMap& headers() const; 62 const HTTPHeaderMap& headers() const;
60 PassRefPtr<BlobDataHandle> blobDataHandle() const; 63 PassRefPtr<BlobDataHandle> blobDataHandle() const;
61 const Referrer& referrer() const; 64 const Referrer& referrer() const;
62 #endif 65 #endif
63 66
64 private: 67 private:
65 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private; 68 WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private;
66 }; 69 };
67 70
68 } // namespace blink 71 } // namespace blink
69 72
70 #endif // WebServiceWorkerRequest_h 73 #endif // WebServiceWorkerRequest_h
OLDNEW
« no previous file with comments | « Source/platform/network/HTTPHeaderMap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698