Chromium Code Reviews| Index: content/common/background_fetch/background_fetch_types.h |
| diff --git a/content/common/background_fetch/background_fetch_types.h b/content/common/background_fetch/background_fetch_types.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6e0723b5ea00882e9114fa4df5d4234a9c330140 |
| --- /dev/null |
| +++ b/content/common/background_fetch/background_fetch_types.h |
| @@ -0,0 +1,60 @@ |
| +// 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. |
| + |
| +#ifndef CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ |
| +#define CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ |
| + |
| +#include <stdint.h> |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "content/common/content_export.h" |
| + |
| +namespace content { |
| + |
| +// Represents the definition of an icon developers can optionally provide with a |
| +// Background Fetch fetch. Analogous to the following structure in the spec: |
| +// https://wicg.github.io/background-fetch/#background-fetch-manager |
| +struct CONTENT_EXPORT IconDefinition { |
| + IconDefinition(); |
| + IconDefinition(const IconDefinition& other); |
|
dcheng
2017/03/21 07:03:20
http://en.cppreference.com/w/cpp/language/move_con
Peter Beverloo
2017/03/21 13:46:27
Acknowledged.
|
| + ~IconDefinition(); |
| + |
| + std::string src; |
| + std::string sizes; |
| + std::string type; |
| +}; |
| + |
| +// Represents the optional options a developer can provide when starting a new |
| +// Background Fetch fetch. Analogous to the following structure in the spec: |
| +// https://wicg.github.io/background-fetch/#background-fetch-manager |
| +struct CONTENT_EXPORT BackgroundFetchOptions { |
| + BackgroundFetchOptions(); |
| + BackgroundFetchOptions(const BackgroundFetchOptions& other); |
| + ~BackgroundFetchOptions(); |
| + |
| + std::vector<IconDefinition> icons; |
| + std::string title; |
| + int64_t total_download_size = 0; |
| +}; |
| + |
| +// Represents the information associated with a Background Fetch registration. |
| +// Analogous to the following structure in the spec: |
| +// https://wicg.github.io/background-fetch/#background-fetch-registration |
| +struct CONTENT_EXPORT BackgroundFetchRegistration { |
| + BackgroundFetchRegistration(); |
| + BackgroundFetchRegistration(const BackgroundFetchRegistration& other); |
| + ~BackgroundFetchRegistration(); |
| + |
| + std::string tag; |
| + std::vector<IconDefinition> icons; |
| + std::string title; |
| + int64_t total_download_size = 0; |
| + |
| + // TODO(peter): Support the `activeFetches` member of the specification. |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_BACKGROUND_FETCH_BACKGROUND_FETCH_TYPES_H_ |