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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_BASE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_BASE_H_
10 class ServiceWorkerRegisterJobBase
{
12 enum RegistrationJobType
{
18 virtual ~ServiceWorkerRegisterJobBase() {}
20 // Starts the job. This method should be called once and only once per job.
21 virtual void Start() = 0;
23 // Aborts the job. This method should be called once and only once per job.
24 // It can be called regardless of whether Start() was called.
25 virtual void Abort() = 0;
27 // Returns true if this job is identical to |job| for the purpose of
28 // collapsing them together in a ServiceWorkerJobCoordinator queue.
29 // Registration jobs are equal if they are for the same pattern and script
30 // URL; unregistration jobs are equal if they are for the same pattern.
31 virtual bool Equals(ServiceWorkerRegisterJobBase
* job
) const = 0;
33 // Returns the type of this job.
34 virtual RegistrationJobType
GetType() const = 0;
37 } // namespace content
39 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_BASE_H_