blob: b4c9b935c66bb80631f2855b64f9bb24dcea64f2 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module content;
import "content/public/common/background_sync.mojom";
import "content/public/common/permission_status.mojom";
import "content/public/common/service_worker_event_status.mojom";
enum BackgroundSyncError {
NONE,
STORAGE,
NOT_FOUND,
NO_SERVICE_WORKER,
NOT_ALLOWED,
MAX=NOT_ALLOWED
};
enum BackgroundSyncState {
PENDING,
FIRING,
UNREGISTERED_WHILE_FIRING,
FAILED,
SUCCESS,
UNREGISTERED
};
interface BackgroundSyncService {
Register(SyncRegistration options, int64 service_worker_registration_id,
bool requested_from_service_worker)
=> (BackgroundSyncError err, SyncRegistration options);
GetRegistration(BackgroundSyncPeriodicity periodicity, string tag,
int64 service_worker_registration_id)
=> (BackgroundSyncError err, SyncRegistration? registration);
GetRegistrations(BackgroundSyncPeriodicity periodicity,
int64 service_worker_registration_id)
=> (BackgroundSyncError err, array<SyncRegistration> registrations);
Unregister(BackgroundSyncPeriodicity periodicity, int32 handle_id,
int64 service_worker_registration_id) => (BackgroundSyncError err);
GetPermissionStatus(BackgroundSyncPeriodicity periodicity,
int64 service_worker_registration_id)
=> (BackgroundSyncError err, PermissionStatus status);
DuplicateRegistrationHandle(int32 handle_id)
=> (BackgroundSyncError err, SyncRegistration? registration);
ReleaseRegistration(int32 handle_id);
NotifyWhenDone(int32 handle_id) => (BackgroundSyncError err, BackgroundSyncState final_status);
};
interface BackgroundSyncServiceClient {
Sync(int32 handle_id)
=> (ServiceWorkerEventStatus status);
};