1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_FETCH_DESCRIPTION_H_
6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_FETCH_DESCRIPTION_H_
7 
8 #include <stdint.h>
9 #include <vector>
10 
11 #include "content/common/content_export.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13 #include "url/origin.h"
14 
15 namespace content {
16 
17 // Contains all information necessary to create a BackgroundFetch download job.
18 struct CONTENT_EXPORT BackgroundFetchDescription {
19   BackgroundFetchDescription(const std::string& job_unique_id,
20                              const url::Origin& origin,
21                              const std::string& title,
22                              const SkBitmap& icon,
23                              int completed_requests,
24                              int total_requests,
25                              uint64_t downloaded_bytes,
26                              uint64_t uploaded_bytes,
27                              uint64_t download_total_bytes,
28                              uint64_t upload_total_bytes,
29                              std::vector<std::string> outstanding_guids,
30                              bool start_paused);
31   ~BackgroundFetchDescription();
32 
33   // Fetch identifiers.
34   const std::string job_unique_id;
35   const url::Origin origin;
36 
37   // UI params.
38   std::string title;
39   SkBitmap icon;
40 
41   // Progress trackers.
42   int completed_requests;
43   int total_requests;
44   uint64_t downloaded_bytes;
45   uint64_t uploaded_bytes;
46   uint64_t download_total_bytes;
47   uint64_t upload_total_bytes;
48 
49   // Initialization params.
50   std::vector<std::string> outstanding_guids;
51   bool start_paused;
52 
53  private:
54   DISALLOW_COPY_AND_ASSIGN(BackgroundFetchDescription);
55 };
56 
57 }  // namespace content
58 
59 #endif  // CONTENT_PUBLIC_BROWSER_BACKGROUND_FETCH_DESCRIPTION_H
60