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

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

Issue 717353004: ServiceWorker: Add support for .skipWaiting and controllerchange event(2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review update Created 6 years 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 23 matching lines...) Expand all
34 virtual void OnVersionAttributesChanged( 34 virtual void OnVersionAttributesChanged(
35 ServiceWorkerRegistration* registration, 35 ServiceWorkerRegistration* registration,
36 ChangedVersionAttributesMask changed_mask, 36 ChangedVersionAttributesMask changed_mask,
37 const ServiceWorkerRegistrationInfo& info) {} 37 const ServiceWorkerRegistrationInfo& info) {}
38 virtual void OnRegistrationFailed( 38 virtual void OnRegistrationFailed(
39 ServiceWorkerRegistration* registration) {} 39 ServiceWorkerRegistration* registration) {}
40 virtual void OnRegistrationFinishedUninstalling( 40 virtual void OnRegistrationFinishedUninstalling(
41 ServiceWorkerRegistration* registration) {} 41 ServiceWorkerRegistration* registration) {}
42 virtual void OnUpdateFound( 42 virtual void OnUpdateFound(
43 ServiceWorkerRegistration* registration) {} 43 ServiceWorkerRegistration* registration) {}
44 virtual void OnSkippedWaiting(ServiceWorkerRegistration* registation) {}
44 }; 45 };
45 46
46 ServiceWorkerRegistration(const GURL& pattern, 47 ServiceWorkerRegistration(const GURL& pattern,
47 int64 registration_id, 48 int64 registration_id,
48 base::WeakPtr<ServiceWorkerContextCore> context); 49 base::WeakPtr<ServiceWorkerContextCore> context);
49 50
50 int64 id() const { return registration_id_; } 51 int64 id() const { return registration_id_; }
51 const GURL& pattern() const { return pattern_; } 52 const GURL& pattern() const { return pattern_; }
52 53
53 bool is_deleted() const { return is_deleted_; } 54 bool is_deleted() const { return is_deleted_; }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void SetWaitingVersion(ServiceWorkerVersion* version); 93 void SetWaitingVersion(ServiceWorkerVersion* version);
93 void SetInstallingVersion(ServiceWorkerVersion* version); 94 void SetInstallingVersion(ServiceWorkerVersion* version);
94 95
95 // If version is the installing, waiting, active version of this 96 // If version is the installing, waiting, active version of this
96 // registation, the method will reset that field to NULL, and notify 97 // registation, the method will reset that field to NULL, and notify
97 // listeners via OnVersionAttributesChanged. 98 // listeners via OnVersionAttributesChanged.
98 void UnsetVersion(ServiceWorkerVersion* version); 99 void UnsetVersion(ServiceWorkerVersion* version);
99 100
100 // Triggers the [[Activate]] algorithm when the currently active version 101 // Triggers the [[Activate]] algorithm when the currently active version
101 // has no controllees. If there are no controllees at the time the method 102 // has no controllees. If there are no controllees at the time the method
102 // is called, activation is initiated immediately. 103 // is called or when version's skip waiting flag is set, activation is
104 // initiated immediately.
103 void ActivateWaitingVersionWhenReady(); 105 void ActivateWaitingVersionWhenReady();
104 106
105 // Triggers the [[ClearRegistration]] algorithm when the currently 107 // Triggers the [[ClearRegistration]] algorithm when the currently
106 // active version has no controllees. Deletes this registration 108 // active version has no controllees. Deletes this registration
107 // from storage immediately. 109 // from storage immediately.
108 void ClearWhenReady(); 110 void ClearWhenReady();
109 111
110 // Restores this registration in storage and cancels the pending 112 // Restores this registration in storage and cancels the pending
111 // [[ClearRegistration]] algorithm. 113 // [[ClearRegistration]] algorithm.
112 void AbortPendingClear(const StatusCallback& callback); 114 void AbortPendingClear(const StatusCallback& callback);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 scoped_refptr<ServiceWorkerVersion> installing_version_; 160 scoped_refptr<ServiceWorkerVersion> installing_version_;
159 ObserverList<Listener> listeners_; 161 ObserverList<Listener> listeners_;
160 base::WeakPtr<ServiceWorkerContextCore> context_; 162 base::WeakPtr<ServiceWorkerContextCore> context_;
161 163
162 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); 164 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration);
163 }; 165 };
164 166
165 } // namespace content 167 } // namespace content
166 168
167 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ 169 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698