summaryrefslogtreecommitdiff
path: root/chromium/content/browser/background_fetch/background_fetch.proto
blob: b33f8003e4b7e6c092b8f6e07ab0338e8a95585d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright 2017 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.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package content.proto;

// Stores per-registration (as opposed to per-request) data.
// https://wicg.github.io/background-fetch/#background-fetch-registration
//
// Next Tag: 7
message BackgroundFetchRegistration {
  // See definition of |unique_id| in BackgroundFetchRegistrationId.
  optional string unique_id = 1;

  // See definition of |developer_id| in BackgroundFetchRegistrationId.
  optional bytes developer_id = 2;

  optional uint64 upload_total = 3;
  optional uint64 uploaded = 4;
  optional uint64 download_total = 5;
  optional uint64 downloaded = 6;
}

// Developer provided options.
// https://wicg.github.io/background-fetch/#background-fetch-manager
//
// Next Tag: 4
message BackgroundFetchOptions {
  optional string title = 1;

  // https://w3c.github.io/manifest/#icons-member
  // Note that sizes can have multiple values (e.g. "32x32 64x64").
  //
  // Next Tag: 4
  message IconDefinition {
    optional string src = 1;
    optional string sizes = 2;
    optional string type = 3;
  }

  // Example value:
  // icons: {
  //   src: "icon/lowres.webp"
  //   sizes: "48x48"
  //   type: "image/webp"
  // }
  // icons: {
  //   src: "icon/hd_hi.ico"
  //   sizes: "72x72 96x96 128x128 256x256"
  // }
  repeated IconDefinition icons = 2;

  optional uint64 download_total = 3;
}

// Stores information about the background fetch that will be persisted
// in memory. This information should be everything needed to reconstruct
// the state of an interrupted background fetch.
//
// Next Tag: 6
message BackgroundFetchMetadata {
  optional int64 creation_microseconds_since_unix_epoch = 1;
  optional string origin = 2;

  optional BackgroundFetchRegistration registration = 3;
  optional BackgroundFetchOptions options = 4;

  // Defaults to BackgroundFetchOptions.title.
  // Can be updated by calling `BackgroundFetchUpdateEvent.updateUI`.
  // https://wicg.github.io/background-fetch/#backgroundfetchupdateevent.
  optional string ui_title = 5;
}