combining_upload_list.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2021 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_UPLOAD_LIST_COMBINING_UPLOAD_LIST_H_
  5. #define COMPONENTS_UPLOAD_LIST_COMBINING_UPLOAD_LIST_H_
  6. #include <vector>
  7. #include "components/upload_list/upload_list.h"
  8. // Presents a combined view of multiple UploadLists as if they were a single
  9. // UploadList
  10. class CombiningUploadList : public UploadList {
  11. public:
  12. // Initialize the CombiningUploadList with all the UploadLists it should
  13. // combine. Note: If one UploadList produces more UploadInfos than the others,
  14. // it is very slightly more efficient to put that one first.
  15. explicit CombiningUploadList(std::vector<scoped_refptr<UploadList>> sublists);
  16. protected:
  17. ~CombiningUploadList() override;
  18. std::vector<UploadInfo> LoadUploadList() override;
  19. void ClearUploadList(const base::Time& begin, const base::Time& end) override;
  20. void RequestSingleUpload(const std::string& local_id) override;
  21. private:
  22. const std::vector<scoped_refptr<UploadList>> sublists_;
  23. };
  24. #endif // COMPONENTS_UPLOAD_LIST_COMBINING_UPLOAD_LIST_H_