1 // Copyright 2015 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.
7 import "content/public/common/background_sync.mojom";
8 import "content/public/common/permission_status.mojom";
9 import "content/public/common/service_worker_event_status.mojom";
11 enum BackgroundSyncError {
20 enum BackgroundSyncState {
23 UNREGISTERED_WHILE_FIRING,
29 interface BackgroundSyncService {
30 Register(SyncRegistration options, int64 service_worker_registration_id,
31 bool requested_from_service_worker)
32 => (BackgroundSyncError err, SyncRegistration options);
33 GetRegistration(BackgroundSyncPeriodicity periodicity, string tag,
34 int64 service_worker_registration_id)
35 => (BackgroundSyncError err, SyncRegistration? registration);
36 GetRegistrations(BackgroundSyncPeriodicity periodicity,
37 int64 service_worker_registration_id)
38 => (BackgroundSyncError err, array<SyncRegistration> registrations);
39 Unregister(BackgroundSyncPeriodicity periodicity, int32 handle_id,
40 int64 service_worker_registration_id) => (BackgroundSyncError err);
41 GetPermissionStatus(BackgroundSyncPeriodicity periodicity,
42 int64 service_worker_registration_id)
43 => (BackgroundSyncError err, PermissionStatus status);
44 DuplicateRegistrationHandle(int32 handle_id)
45 => (BackgroundSyncError err, SyncRegistration? registration);
46 ReleaseRegistration(int32 handle_id);
47 NotifyWhenDone(int32 handle_id) => (BackgroundSyncError err, BackgroundSyncState final_status);
50 interface BackgroundSyncServiceClient {
52 => (ServiceWorkerEventStatus status);