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

Side by Side Diff: content/common/service_worker/service_worker_types.h

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix tests Created 3 years, 9 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 // 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 CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // Returns whether the instance is valid. A valid instance has valid 212 // Returns whether the instance is valid. A valid instance has valid
213 // |handle_id| and |version_id|. 213 // |handle_id| and |version_id|.
214 bool IsValid() const; 214 bool IsValid() const;
215 215
216 int handle_id; 216 int handle_id;
217 GURL url; 217 GURL url;
218 blink::WebServiceWorkerState state; 218 blink::WebServiceWorkerState state;
219 int64_t version_id; 219 int64_t version_id;
220 }; 220 };
221 221
222 struct CONTENT_EXPORT ServiceWorkerRegistrationOptions {
223 enum class UseCache { DontUse, Use, Last = Use };
224
225 ServiceWorkerRegistrationOptions();
226 // Initialize |scope| with the specified value and the rest with defaults
227 explicit ServiceWorkerRegistrationOptions(const GURL& scope);
228 ServiceWorkerRegistrationOptions(const GURL& scope, UseCache use_cache);
229 GURL scope;
230 UseCache use_cache;
231 };
232
222 struct CONTENT_EXPORT ServiceWorkerRegistrationObjectInfo { 233 struct CONTENT_EXPORT ServiceWorkerRegistrationObjectInfo {
223 ServiceWorkerRegistrationObjectInfo(); 234 ServiceWorkerRegistrationObjectInfo();
224 int handle_id; 235 int handle_id;
225 GURL scope; 236 ServiceWorkerRegistrationOptions options;
226 int64_t registration_id; 237 int64_t registration_id;
227 }; 238 };
228 239
229 struct ServiceWorkerVersionAttributes { 240 struct ServiceWorkerVersionAttributes {
230 ServiceWorkerObjectInfo installing; 241 ServiceWorkerObjectInfo installing;
231 ServiceWorkerObjectInfo waiting; 242 ServiceWorkerObjectInfo waiting;
232 ServiceWorkerObjectInfo active; 243 ServiceWorkerObjectInfo active;
233 }; 244 };
234 245
235 class ChangedVersionAttributesMask { 246 class ChangedVersionAttributesMask {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 NavigationPreloadState(); 289 NavigationPreloadState();
279 NavigationPreloadState(bool enabled, std::string header); 290 NavigationPreloadState(bool enabled, std::string header);
280 NavigationPreloadState(const NavigationPreloadState& other); 291 NavigationPreloadState(const NavigationPreloadState& other);
281 bool enabled; 292 bool enabled;
282 std::string header; 293 std::string header;
283 }; 294 };
284 295
285 } // namespace content 296 } // namespace content
286 297
287 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_ 298 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698