| 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 | 9 |
| 10 enum BackgroundSyncError { | 10 enum BackgroundSyncError { |
| 11 NONE, | 11 NONE, |
| 12 STORAGE, | 12 STORAGE, |
| 13 NOT_FOUND, | 13 NOT_FOUND, |
| 14 NO_SERVICE_WORKER, | 14 NO_SERVICE_WORKER, |
| 15 MAX=NO_SERVICE_WORKER | 15 MAX=NO_SERVICE_WORKER |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 enum BackgroundSyncEventStatus { |
| 19 COMPLETED, |
| 20 REJECTED, |
| 21 ABORT, |
| 22 MAX=ABORT |
| 23 }; |
| 24 |
| 18 interface BackgroundSyncService { | 25 interface BackgroundSyncService { |
| 19 Register(SyncRegistration options, int64 service_worker_registration_id) | 26 Register(SyncRegistration options, int64 service_worker_registration_id) |
| 20 => (BackgroundSyncError err, SyncRegistration options); | 27 => (BackgroundSyncError err, SyncRegistration options); |
| 21 GetRegistration(BackgroundSyncPeriodicity periodicity, string tag, | 28 GetRegistration(BackgroundSyncPeriodicity periodicity, string tag, |
| 22 int64 service_worker_registration_id) | 29 int64 service_worker_registration_id) |
| 23 => (BackgroundSyncError err, SyncRegistration? registration); | 30 => (BackgroundSyncError err, SyncRegistration? registration); |
| 24 GetRegistrations(BackgroundSyncPeriodicity periodicity, | 31 GetRegistrations(BackgroundSyncPeriodicity periodicity, |
| 25 int64 service_worker_registration_id) | 32 int64 service_worker_registration_id) |
| 26 => (BackgroundSyncError err, array<SyncRegistration> registrations); | 33 => (BackgroundSyncError err, array<SyncRegistration> registrations); |
| 27 Unregister(BackgroundSyncPeriodicity periodicity, int64 id, string tag, | 34 Unregister(BackgroundSyncPeriodicity periodicity, int64 id, string tag, |
| 28 int64 service_worker_registration_id) => (BackgroundSyncError err); | 35 int64 service_worker_registration_id) => (BackgroundSyncError err); |
| 29 GetPermissionStatus(BackgroundSyncPeriodicity periodicity, | 36 GetPermissionStatus(BackgroundSyncPeriodicity periodicity, |
| 30 int64 service_worker_registration_id) | 37 int64 service_worker_registration_id) |
| 31 => (BackgroundSyncError err, PermissionStatus status); | 38 => (BackgroundSyncError err, PermissionStatus status); |
| 32 }; | 39 }; |
| 33 | 40 |
| 34 interface BackgoundSyncServiceClient { | 41 interface BackgroundSyncServiceClient { |
| 35 Sync(SyncRegistration event); | 42 Sync(SyncRegistration event, int32 thread_id) => (BackgroundSyncEventStatus st
atus); |
| 36 }; | 43 }; |
| 37 | 44 |
| OLD | NEW |