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

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

Issue 2119143002: service worker: Wait for inflight requests before activating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nhiroki-san 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 // 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 friend class base::RefCounted<ServiceWorkerRegistration>; 154 friend class base::RefCounted<ServiceWorkerRegistration>;
155 155
156 ~ServiceWorkerRegistration() override; 156 ~ServiceWorkerRegistration() override;
157 157
158 void UnsetVersionInternal( 158 void UnsetVersionInternal(
159 ServiceWorkerVersion* version, 159 ServiceWorkerVersion* version,
160 ChangedVersionAttributesMask* mask); 160 ChangedVersionAttributesMask* mask);
161 161
162 // ServiceWorkerVersion::Listener override. 162 // ServiceWorkerVersion::Listener override.
163 void OnNoControllees(ServiceWorkerVersion* version) override; 163 void OnNoControllees(ServiceWorkerVersion* version) override;
164 void OnNoInflightRequests(ServiceWorkerVersion* version) override;
165
166 bool IsReadyToActivate() const;
164 167
165 // Promotes the waiting version to active version. If |delay| is true, waits 168 // Promotes the waiting version to active version. If |delay| is true, waits
166 // a short time before attempting to start and dispatch the activate event 169 // a short time before attempting to start and dispatch the activate event
167 // to the version. 170 // to the version.
168 void ActivateWaitingVersion(bool delay); 171 void ActivateWaitingVersion(bool delay);
169 void ContinueActivation( 172 void ContinueActivation(
170 scoped_refptr<ServiceWorkerVersion> activating_version); 173 scoped_refptr<ServiceWorkerVersion> activating_version);
171 void DispatchActivateEvent( 174 void DispatchActivateEvent(
172 scoped_refptr<ServiceWorkerVersion> activating_version); 175 scoped_refptr<ServiceWorkerVersion> activating_version);
173 void OnActivateEventFinished( 176 void OnActivateEventFinished(
(...skipping 27 matching lines...) Expand all
201 std::vector<base::Closure> registration_finished_callbacks_; 204 std::vector<base::Closure> registration_finished_callbacks_;
202 base::WeakPtr<ServiceWorkerContextCore> context_; 205 base::WeakPtr<ServiceWorkerContextCore> context_;
203 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 206 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
204 207
205 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); 208 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration);
206 }; 209 };
207 210
208 } // namespace content 211 } // namespace content
209 212
210 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ 213 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698