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

Side by Side Diff: content/browser/service_worker/service_worker_registration.h

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: Move API change to another patch and address comments Created 3 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ServiceWorkerRegistration* registration) {} 49 ServiceWorkerRegistration* registration) {}
50 virtual void OnSkippedWaiting(ServiceWorkerRegistration* registation) {} 50 virtual void OnSkippedWaiting(ServiceWorkerRegistration* registation) {}
51 }; 51 };
52 52
53 ServiceWorkerRegistration(const ServiceWorkerRegistrationOptions& options, 53 ServiceWorkerRegistration(const ServiceWorkerRegistrationOptions& options,
54 int64_t registration_id, 54 int64_t registration_id,
55 base::WeakPtr<ServiceWorkerContextCore> context); 55 base::WeakPtr<ServiceWorkerContextCore> context);
56 56
57 int64_t id() const { return registration_id_; } 57 int64_t id() const { return registration_id_; }
58 const GURL& pattern() const { return pattern_; } 58 const GURL& pattern() const { return pattern_; }
59 blink::WebServiceWorkerUpdateViaCache update_via_cache() const {
60 return update_via_cache_;
61 }
59 62
60 bool is_deleted() const { return is_deleted_; } 63 bool is_deleted() const { return is_deleted_; }
61 void set_is_deleted(bool deleted) { is_deleted_ = deleted; } 64 void set_is_deleted(bool deleted) { is_deleted_ = deleted; }
62 65
63 bool is_uninstalling() const { return is_uninstalling_; } 66 bool is_uninstalling() const { return is_uninstalling_; }
64 67
65 void set_is_uninstalled(bool uninstalled) { is_uninstalled_ = uninstalled; } 68 void set_is_uninstalled(bool uninstalled) { is_uninstalled_ = uninstalled; }
66 bool is_uninstalled() const { return is_uninstalled_; } 69 bool is_uninstalled() const { return is_uninstalled_; }
67 70
68 int64_t resources_total_size_bytes() const { 71 int64_t resources_total_size_bytes() const {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 void OnDeleteFinished(ServiceWorkerStatusCode status); 194 void OnDeleteFinished(ServiceWorkerStatusCode status);
192 195
193 // This method corresponds to the [[ClearRegistration]] algorithm. 196 // This method corresponds to the [[ClearRegistration]] algorithm.
194 void Clear(); 197 void Clear();
195 198
196 void OnRestoreFinished(const StatusCallback& callback, 199 void OnRestoreFinished(const StatusCallback& callback,
197 scoped_refptr<ServiceWorkerVersion> version, 200 scoped_refptr<ServiceWorkerVersion> version,
198 ServiceWorkerStatusCode status); 201 ServiceWorkerStatusCode status);
199 202
200 const GURL pattern_; 203 const GURL pattern_;
204 const blink::WebServiceWorkerUpdateViaCache update_via_cache_;
201 const int64_t registration_id_; 205 const int64_t registration_id_;
202 bool is_deleted_; 206 bool is_deleted_;
203 bool is_uninstalling_; 207 bool is_uninstalling_;
204 bool is_uninstalled_; 208 bool is_uninstalled_;
205 bool should_activate_when_ready_; 209 bool should_activate_when_ready_;
206 NavigationPreloadState navigation_preload_state_; 210 NavigationPreloadState navigation_preload_state_;
207 base::Time last_update_check_; 211 base::Time last_update_check_;
208 int64_t resources_total_size_bytes_; 212 int64_t resources_total_size_bytes_;
209 213
210 // This registration is the primary owner of these versions. 214 // This registration is the primary owner of these versions.
(...skipping 13 matching lines...) Expand all
224 // It is stopped when activation completes or the active version is no 228 // It is stopped when activation completes or the active version is no
225 // longer considered a lame duck. 229 // longer considered a lame duck.
226 base::RepeatingTimer lame_duck_timer_; 230 base::RepeatingTimer lame_duck_timer_;
227 231
228 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); 232 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration);
229 }; 233 };
230 234
231 } // namespace content 235 } // namespace content
232 236
233 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ 237 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698