| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 blink.mojom; | 5 module blink.mojom; |
| 6 | 6 |
| 7 enum BackgroundFetchError { | 7 enum BackgroundFetchError { |
| 8 NONE, | 8 NONE, |
| 9 DUPLICATED_TAG | 9 DUPLICATED_TAG, |
| 10 INVALID_TAG |
| 10 }; | 11 }; |
| 11 | 12 |
| 12 struct IconDefinition { | 13 struct IconDefinition { |
| 13 string src; | 14 string src; |
| 14 string sizes; | 15 string sizes; |
| 15 string type; | 16 string type; |
| 16 }; | 17 }; |
| 17 | 18 |
| 18 struct BackgroundFetchRegistration { | 19 struct BackgroundFetchRegistration { |
| 19 string tag; | 20 string tag; |
| 20 array<IconDefinition> icons; | 21 array<IconDefinition> icons; |
| 21 int64 total_download_size = 0; | 22 int64 total_download_size = 0; |
| 22 string title = ""; | 23 string title = ""; |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 interface BackgroundFetchService { | 26 interface BackgroundFetchService { |
| 26 // TODO(peter): Implement support for the `fetch()` function in Mojo. | 27 // TODO(peter): Implement support for the `fetch()` function in Mojo. |
| 27 | 28 |
| 28 // Updates the user interface for the Background Fetch identified by the | 29 // Updates the user interface for the Background Fetch identified by the |
| 29 // |service_worker_registration_id| and the |tag|. | 30 // |service_worker_registration_id| and the |tag|. |
| 30 UpdateUI(int64 service_worker_registration_id, string tag, string title) | 31 UpdateUI(int64 service_worker_registration_id, string tag, string title) |
| 31 => (BackgroundFetchError error); | 32 => (BackgroundFetchError error); |
| 32 | 33 |
| 33 // Aborts the Background Fetch registration identified by the | 34 // Aborts the Background Fetch registration identified by the |
| 34 // |service_worker_registration_id| and the |tag|. | 35 // |service_worker_registration_id| and the |tag|. |
| 35 Abort(int64 service_worker_registration_id, string tag); | 36 Abort(int64 service_worker_registration_id, string tag) |
| 37 => (BackgroundFetchError error); |
| 36 | 38 |
| 37 // Gets the Background Fetch registration identified by the | 39 // Gets the Background Fetch registration identified by the |
| 38 // |service_worker_registration_id| and the |tag|. | 40 // |service_worker_registration_id| and the |tag|. |
| 39 GetRegistration(int64 service_worker_registration_id, string tag) | 41 GetRegistration(int64 service_worker_registration_id, string tag) |
| 40 => (BackgroundFetchError error, | 42 => (BackgroundFetchError error, |
| 41 BackgroundFetchRegistration? registration); | 43 BackgroundFetchRegistration? registration); |
| 42 | 44 |
| 43 // Gets the sequence of tags for active Background Fetch registrations given | 45 // Gets the sequence of tags for active Background Fetch registrations given |
| 44 // the |service_worker_registration_id|. | 46 // the |service_worker_registration_id|. |
| 45 GetTags(int64 service_worker_registration_id) | 47 GetTags(int64 service_worker_registration_id) |
| 46 => (BackgroundFetchError error, | 48 => (BackgroundFetchError error, |
| 47 array<string> tags); | 49 array<string> tags); |
| 48 }; | 50 }; |
| OLD | NEW |