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 #ifndef CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ | 5 #ifndef CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ |
6 #define CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ | 6 #define CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/service_worker/service_worker_types.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 // Represents the definition of an icon developers can optionally provide with a | 17 // Represents the definition of an icon developers can optionally provide with a |
17 // Background Fetch fetch. Analogous to the following structure in the spec: | 18 // Background Fetch fetch. Analogous to the following structure in the spec: |
18 // https://wicg.github.io/background-fetch/#background-fetch-manager | 19 // https://wicg.github.io/background-fetch/#background-fetch-manager |
19 // | 20 // |
20 // Parsing of the icon definitions as well as fetching an appropriate icon will | 21 // Parsing of the icon definitions as well as fetching an appropriate icon will |
21 // be done by Blink in the renderer process. The browser process is expected to | 22 // be done by Blink in the renderer process. The browser process is expected to |
22 // treat these values as opaque strings. | 23 // treat these values as opaque strings. |
(...skipping 29 matching lines...) Expand all Loading... |
52 ~BackgroundFetchRegistration(); | 53 ~BackgroundFetchRegistration(); |
53 | 54 |
54 std::string tag; | 55 std::string tag; |
55 std::vector<IconDefinition> icons; | 56 std::vector<IconDefinition> icons; |
56 std::string title; | 57 std::string title; |
57 int64_t total_download_size = 0; | 58 int64_t total_download_size = 0; |
58 | 59 |
59 // TODO(peter): Support the `activeFetches` member of the specification. | 60 // TODO(peter): Support the `activeFetches` member of the specification. |
60 }; | 61 }; |
61 | 62 |
| 63 // Represents a request/response pair for a settled Background Fetch fetch. |
| 64 // Analogous to the following structure in the spec: |
| 65 // http://wicg.github.io/background-fetch/#backgroundfetchsettledfetch |
| 66 struct CONTENT_EXPORT BackgroundFetchSettledFetch { |
| 67 BackgroundFetchSettledFetch(); |
| 68 BackgroundFetchSettledFetch(const BackgroundFetchSettledFetch& other); |
| 69 ~BackgroundFetchSettledFetch(); |
| 70 |
| 71 ServiceWorkerFetchRequest request; |
| 72 ServiceWorkerResponse response; |
| 73 }; |
| 74 |
62 } // namespace content | 75 } // namespace content |
63 | 76 |
64 #endif // CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ | 77 #endif // CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ |
OLD | NEW |