OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 module content; | 5 module content; |
6 | 6 |
7 import "content/public/common/background_sync.mojom"; | 7 import "content/public/common/background_sync.mojom"; |
8 import "content/public/common/permission_status.mojom"; | 8 import "content/public/common/permission_status.mojom"; |
9 import "content/public/common/service_worker_event_status.mojom"; | 9 import "content/public/common/service_worker_event_status.mojom"; |
10 | 10 |
11 enum BackgroundSyncError { | 11 enum BackgroundSyncError { |
12 NONE, | 12 NONE, |
13 STORAGE, | 13 STORAGE, |
14 NOT_FOUND, | 14 NOT_FOUND, |
15 NO_SERVICE_WORKER, | 15 NO_SERVICE_WORKER, |
16 NOT_ALLOWED, | 16 NOT_ALLOWED, |
17 MAX=NOT_ALLOWED | 17 MAX=NOT_ALLOWED |
18 }; | 18 }; |
19 | 19 |
20 enum BackgroundSyncState { | 20 enum BackgroundSyncState { |
21 PENDING, | 21 PENDING, |
22 FIRING, | 22 FIRING, |
23 FAILED | 23 FAILED, |
| 24 SUCCESS, |
| 25 UNREGISTERED |
24 }; | 26 }; |
25 | 27 |
26 interface BackgroundSyncService { | 28 interface BackgroundSyncService { |
27 Register(SyncRegistration options, int64 service_worker_registration_id, | 29 Register(SyncRegistration options, int64 service_worker_registration_id, |
28 bool requested_from_service_worker) | 30 bool requested_from_service_worker) |
29 => (BackgroundSyncError err, SyncRegistration options); | 31 => (BackgroundSyncError err, SyncRegistration options); |
30 GetRegistration(BackgroundSyncPeriodicity periodicity, string tag, | 32 GetRegistration(BackgroundSyncPeriodicity periodicity, string tag, |
31 int64 service_worker_registration_id) | 33 int64 service_worker_registration_id) |
32 => (BackgroundSyncError err, SyncRegistration? registration); | 34 => (BackgroundSyncError err, SyncRegistration? registration); |
33 GetRegistrations(BackgroundSyncPeriodicity periodicity, | 35 GetRegistrations(BackgroundSyncPeriodicity periodicity, |
34 int64 service_worker_registration_id) | 36 int64 service_worker_registration_id) |
35 => (BackgroundSyncError err, array<SyncRegistration> registrations); | 37 => (BackgroundSyncError err, array<SyncRegistration> registrations); |
36 Unregister(BackgroundSyncPeriodicity periodicity, int32 handle_id, | 38 Unregister(BackgroundSyncPeriodicity periodicity, int32 handle_id, |
37 int64 service_worker_registration_id) => (BackgroundSyncError err); | 39 int64 service_worker_registration_id) => (BackgroundSyncError err); |
38 GetPermissionStatus(BackgroundSyncPeriodicity periodicity, | 40 GetPermissionStatus(BackgroundSyncPeriodicity periodicity, |
39 int64 service_worker_registration_id) | 41 int64 service_worker_registration_id) |
40 => (BackgroundSyncError err, PermissionStatus status); | 42 => (BackgroundSyncError err, PermissionStatus status); |
41 DuplicateRegistrationHandle(int32 handle_id) | 43 DuplicateRegistrationHandle(int32 handle_id) |
42 => (BackgroundSyncError err, SyncRegistration? registration); | 44 => (BackgroundSyncError err, SyncRegistration? registration); |
43 ReleaseRegistration(int32 handle_id); | 45 ReleaseRegistration(int32 handle_id); |
| 46 NotifyWhenDone(int32 handle_id) => (BackgroundSyncError err, BackgroundSyncSta
te final_status); |
44 }; | 47 }; |
45 | 48 |
46 interface BackgroundSyncServiceClient { | 49 interface BackgroundSyncServiceClient { |
47 Sync(int32 handle_id) | 50 Sync(int32 handle_id) |
48 => (ServiceWorkerEventStatus status); | 51 => (ServiceWorkerEventStatus status); |
49 }; | 52 }; |
50 | 53 |
OLD | NEW |