summaryrefslogtreecommitdiff
path: root/chromium/components/download/database/download_info.h
blob: 483115fb72e5b52a8caed7ebd6f50ce41649cf9a (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
// Copyright 2018 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 COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_INFO_H_
#define COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_INFO_H_

#include <string>

#include "base/optional.h"
#include "components/download/database/in_progress/in_progress_info.h"
#include "components/download/database/in_progress/ukm_info.h"

namespace download {

// Contains needed information to reconstruct a download item.
struct DownloadInfo {
 public:
  DownloadInfo();
  DownloadInfo(const DownloadInfo& other);
  ~DownloadInfo();

  bool operator==(const DownloadInfo& other) const;

  // Download GUID.
  std::string guid;

  // Download ID.
  // Deprecated, only kept for the purpose of download extension API.
  int id = -1;

  // UKM information for reporting.
  base::Optional<UkmInfo> ukm_info;

  // In progress information for active download.
  base::Optional<InProgressInfo> in_progress_info;
};

}  // namespace download

#endif  // COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_INFO_H_