download_info.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_INFO_H_
  5. #define COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_INFO_H_
  6. #include <string>
  7. #include "components/download/database/in_progress/in_progress_info.h"
  8. #include "components/download/database/in_progress/ukm_info.h"
  9. #include "third_party/abseil-cpp/absl/types/optional.h"
  10. namespace download {
  11. // Contains needed information to reconstruct a download item.
  12. struct DownloadInfo {
  13. public:
  14. DownloadInfo();
  15. DownloadInfo(const DownloadInfo& other);
  16. ~DownloadInfo();
  17. bool operator==(const DownloadInfo& other) const;
  18. // Download GUID.
  19. std::string guid;
  20. // Download ID.
  21. // Deprecated, only kept for the purpose of download extension API.
  22. int id = -1;
  23. // UKM information for reporting.
  24. absl::optional<UkmInfo> ukm_info;
  25. // In progress information for active download.
  26. absl::optional<InProgressInfo> in_progress_info;
  27. };
  28. } // namespace download
  29. #endif // COMPONENTS_DOWNLOAD_DATABASE_DOWNLOAD_INFO_H_