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

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

Issue 587213003: [ServiceWorker] Plumbing the request mode from the renderer to the ServiceWorker. [1/2 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « public/platform/WebServiceWorkerRequest.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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 }; 103 };
104 104
105 // Corresponds to Fetch's "context frame type": http://fetch.spec.whatwg.org /#concept-request-context-frame-type 105 // Corresponds to Fetch's "context frame type": http://fetch.spec.whatwg.org /#concept-request-context-frame-type
106 enum FrameType { 106 enum FrameType {
107 FrameTypeAuxiliary, 107 FrameTypeAuxiliary,
108 FrameTypeNested, 108 FrameTypeNested,
109 FrameTypeNone, 109 FrameTypeNone,
110 FrameTypeTopLevel 110 FrameTypeTopLevel
111 }; 111 };
112 112
113 enum ServiceWorkerRequestMode {
yhirano 2014/09/25 02:08:44 Is this name appropriate? Having FetchRequestMode
horo 2014/09/25 03:55:18 Done.
114 ServiceWorkerRequestModeSkip,
115 ServiceWorkerRequestModeSameOrigin,
116 ServiceWorkerRequestModeNoCORS,
117 ServiceWorkerRequestModeCORS,
118 ServiceWorkerRequestModeCORSWithForcedPreflight
119 };
120
113 class ExtraData { 121 class ExtraData {
114 public: 122 public:
115 virtual ~ExtraData() { } 123 virtual ~ExtraData() { }
116 }; 124 };
117 125
118 ~WebURLRequest() { reset(); } 126 ~WebURLRequest() { reset(); }
119 127
120 WebURLRequest() : m_private(0) { } 128 WebURLRequest() : m_private(0) { }
121 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } 129 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); }
122 WebURLRequest& operator=(const WebURLRequest& r) 130 WebURLRequest& operator=(const WebURLRequest& r)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 212
205 // Allows the request to be matched up with its app cache host. 213 // Allows the request to be matched up with its app cache host.
206 BLINK_PLATFORM_EXPORT int appCacheHostID() const; 214 BLINK_PLATFORM_EXPORT int appCacheHostID() const;
207 BLINK_PLATFORM_EXPORT void setAppCacheHostID(int); 215 BLINK_PLATFORM_EXPORT void setAppCacheHostID(int);
208 216
209 // If true, the response body will be downloaded to a file managed by the 217 // If true, the response body will be downloaded to a file managed by the
210 // WebURLLoader. See WebURLResponse::downloadedFilePath. 218 // WebURLLoader. See WebURLResponse::downloadedFilePath.
211 BLINK_PLATFORM_EXPORT bool downloadToFile() const; 219 BLINK_PLATFORM_EXPORT bool downloadToFile() const;
212 BLINK_PLATFORM_EXPORT void setDownloadToFile(bool); 220 BLINK_PLATFORM_EXPORT void setDownloadToFile(bool);
213 221
214 // True if the request should not be handled by the ServiceWorker. 222 // FIXME: Remove this.
215 BLINK_PLATFORM_EXPORT bool skipServiceWorker() const; 223 BLINK_PLATFORM_EXPORT bool skipServiceWorker() const;
216 BLINK_PLATFORM_EXPORT void setSkipServiceWorker(bool); 224 // The request mode which will be passed to the ServiceWorker.
225 BLINK_PLATFORM_EXPORT ServiceWorkerRequestMode serviceWorkerRequestMode() co nst;
226 BLINK_PLATFORM_EXPORT void setServiceWorkerRequestMode(ServiceWorkerRequestM ode);
217 227
218 // Extra data associated with the underlying resource request. Resource 228 // Extra data associated with the underlying resource request. Resource
219 // requests can be copied. If non-null, each copy of a resource requests 229 // requests can be copied. If non-null, each copy of a resource requests
220 // holds a pointer to the extra data, and the extra data pointer will be 230 // holds a pointer to the extra data, and the extra data pointer will be
221 // deleted when the last resource request is destroyed. Setting the extra 231 // deleted when the last resource request is destroyed. Setting the extra
222 // data pointer will cause the underlying resource request to be 232 // data pointer will cause the underlying resource request to be
223 // dissociated from any existing non-null extra data pointer. 233 // dissociated from any existing non-null extra data pointer.
224 BLINK_PLATFORM_EXPORT ExtraData* extraData() const; 234 BLINK_PLATFORM_EXPORT ExtraData* extraData() const;
225 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); 235 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
226 236
227 BLINK_PLATFORM_EXPORT Priority priority() const; 237 BLINK_PLATFORM_EXPORT Priority priority() const;
228 BLINK_PLATFORM_EXPORT void setPriority(Priority); 238 BLINK_PLATFORM_EXPORT void setPriority(Priority);
229 239
230 #if INSIDE_BLINK 240 #if INSIDE_BLINK
231 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest(); 241 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest();
232 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const; 242 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const;
233 #endif 243 #endif
234 244
235 protected: 245 protected:
236 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); 246 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*);
237 247
238 private: 248 private:
239 WebURLRequestPrivate* m_private; 249 WebURLRequestPrivate* m_private;
240 }; 250 };
241 251
242 } // namespace blink 252 } // namespace blink
243 253
244 #endif 254 #endif
OLDNEW
« no previous file with comments | « public/platform/WebServiceWorkerRequest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698