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

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

Issue 2105503002: Skip foreign fetch when the skipServiceWorker flag is set on a request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments explaing why skip is set to ::Controlling for fallback requests Created 4 years, 5 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
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 ReportIntent, // Report metrics with UI action displayed intent. 134 ReportIntent, // Report metrics with UI action displayed intent.
135 }; 135 };
136 136
137 // The LoFi state which determines whether to request a Lo-Fi version of the resource. 137 // The LoFi state which determines whether to request a Lo-Fi version of the resource.
138 enum LoFiState { 138 enum LoFiState {
139 LoFiUnspecified, // Let the browser process decide whether or not to req uest the Lo-Fi version. 139 LoFiUnspecified, // Let the browser process decide whether or not to req uest the Lo-Fi version.
140 LoFiOff, // Request a normal (non-Lo-Fi) version of the resource. 140 LoFiOff, // Request a normal (non-Lo-Fi) version of the resource.
141 LoFiOn, // Request a Lo-Fi version of the resource. 141 LoFiOn, // Request a Lo-Fi version of the resource.
142 }; 142 };
143 143
144 // Whether or not a request should be handled by a ServiceWorker.
kinuko 2016/06/30 09:38:22 ditto. Also-- started to wonder if we could have
Marijn Kruisselbrink 2016/06/30 17:41:54 We could... we'd need to move the enums we'd want
145 enum class SkipServiceWorker {
146 // Request can be handled both by a controlling same-origin worker and
147 // a cross-origin foreign fetch service worker.
148 None,
149 // Request should not be handled by a same-origin controlling worker,
150 // but can be intercepted by a foreign fetch service worker.
151 Controlling,
152 // Request should skip all possible service workers.
153 All
154 };
155
144 class ExtraData { 156 class ExtraData {
145 public: 157 public:
146 virtual ~ExtraData() { } 158 virtual ~ExtraData() { }
147 }; 159 };
148 160
149 ~WebURLRequest() { reset(); } 161 ~WebURLRequest() { reset(); }
150 162
151 WebURLRequest() : m_private(0) { } 163 WebURLRequest() : m_private(0) { }
152 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } 164 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); }
153 WebURLRequest& operator=(const WebURLRequest& r) 165 WebURLRequest& operator=(const WebURLRequest& r)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // If true, the response body will be downloaded to a file managed by the 260 // If true, the response body will be downloaded to a file managed by the
249 // WebURLLoader. See WebURLResponse::downloadedFilePath. 261 // WebURLLoader. See WebURLResponse::downloadedFilePath.
250 BLINK_PLATFORM_EXPORT bool downloadToFile() const; 262 BLINK_PLATFORM_EXPORT bool downloadToFile() const;
251 BLINK_PLATFORM_EXPORT void setDownloadToFile(bool); 263 BLINK_PLATFORM_EXPORT void setDownloadToFile(bool);
252 264
253 // True if the requestor wants to receive the response body as a stream. 265 // True if the requestor wants to receive the response body as a stream.
254 BLINK_PLATFORM_EXPORT bool useStreamOnResponse() const; 266 BLINK_PLATFORM_EXPORT bool useStreamOnResponse() const;
255 BLINK_PLATFORM_EXPORT void setUseStreamOnResponse(bool); 267 BLINK_PLATFORM_EXPORT void setUseStreamOnResponse(bool);
256 268
257 // True if the request should not be handled by the ServiceWorker. 269 // True if the request should not be handled by the ServiceWorker.
258 BLINK_PLATFORM_EXPORT bool skipServiceWorker() const; 270 BLINK_PLATFORM_EXPORT SkipServiceWorker skipServiceWorker() const;
259 BLINK_PLATFORM_EXPORT void setSkipServiceWorker(bool); 271 BLINK_PLATFORM_EXPORT void setSkipServiceWorker(SkipServiceWorker);
260 272
261 // True if corresponding AppCache group should be resetted. 273 // True if corresponding AppCache group should be resetted.
262 BLINK_PLATFORM_EXPORT bool shouldResetAppCache() const; 274 BLINK_PLATFORM_EXPORT bool shouldResetAppCache() const;
263 BLINK_PLATFORM_EXPORT void setShouldResetAppCache(bool); 275 BLINK_PLATFORM_EXPORT void setShouldResetAppCache(bool);
264 276
265 // The request mode which will be passed to the ServiceWorker. 277 // The request mode which will be passed to the ServiceWorker.
266 BLINK_PLATFORM_EXPORT FetchRequestMode getFetchRequestMode() const; 278 BLINK_PLATFORM_EXPORT FetchRequestMode getFetchRequestMode() const;
267 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode); 279 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode);
268 280
269 // The credentials mode which will be passed to the ServiceWorker. 281 // The credentials mode which will be passed to the ServiceWorker.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 protected: 328 protected:
317 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); 329 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*);
318 330
319 private: 331 private:
320 WebURLRequestPrivate* m_private; 332 WebURLRequestPrivate* m_private;
321 }; 333 };
322 334
323 } // namespace blink 335 } // namespace blink
324 336
325 #endif 337 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698