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

Unified Diff: content/browser/service_worker/service_worker_job_coordinator.h

Issue 345583002: ServiceWorker: Add a function to abort all pending jobs in SWJobCoordinator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert to PS2 Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_job_coordinator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_job_coordinator.h
diff --git a/content/browser/service_worker/service_worker_job_coordinator.h b/content/browser/service_worker/service_worker_job_coordinator.h
index 4817a52fcbaabd7e61953dba04ef0985f4b35f4b..06a1057d76e43d2979857747d9e1dc97b0c24549 100644
--- a/content/browser/service_worker/service_worker_job_coordinator.h
+++ b/content/browser/service_worker/service_worker_job_coordinator.h
@@ -35,7 +35,11 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator {
const GURL& pattern,
const ServiceWorkerUnregisterJob::UnregistrationCallback& callback);
- // Jobs are removed whenever they are finished or canceled.
+ // Calls ServiceWorkerRegisterJobBase::Abort() on all jobs and removes them.
+ void AbortAll();
+
+ // Removes the job. A job that was not aborted must call FinishJob when it is
+ // done.
void FinishJob(const GURL& pattern, ServiceWorkerRegisterJobBase* job);
private:
@@ -55,6 +59,9 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator {
bool empty() { return jobs_.empty(); }
+ // Aborts all jobs in the queue and removes them.
+ void AbortAll();
+
// Marks that the browser is shutting down, so jobs may be destroyed before
// finishing.
void ClearForShutdown();
@@ -68,7 +75,7 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator {
// The ServiceWorkerContextCore object should always outlive the
// job coordinator, the core owns the coordinator.
base::WeakPtr<ServiceWorkerContextCore> context_;
- RegistrationJobMap jobs_;
+ RegistrationJobMap job_queues_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerJobCoordinator);
};
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_job_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698