Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / service_worker / service_worker_register_job_base.h
blob9233e7c69af1a079053142c4d7f1f435b25f0533
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_
8 namespace content {
10 class ServiceWorkerRegisterJobBase {
11 public:
12 enum RegistrationJobType {
13 REGISTRATION_JOB,
14 UNREGISTRATION_JOB,
15 UPDATE_JOB
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) = 0;
33 // Returns the type of this job.
34 virtual RegistrationJobType GetType() = 0;
37 } // namespace content
39 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_BASE_H_