Chromium Code Reviews| Index: components/upload_list/upload_list.h |
| diff --git a/components/upload_list/upload_list.h b/components/upload_list/upload_list.h |
| index 0a237a4f7c0bda34e8ede8c1a2bb7d1bc77d1b01..97da430eec6e0b9e69947e2a620e72961d546c4a 100644 |
| --- a/components/upload_list/upload_list.h |
| +++ b/components/upload_list/upload_list.h |
| @@ -9,7 +9,6 @@ |
| #include <vector> |
| #include "base/files/file_path.h" |
| -#include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/threading/thread_checker.h" |
| @@ -75,45 +74,37 @@ class UploadList : public base::RefCountedThreadSafe<UploadList> { |
| // Populates |uploads| with the |max_count| most recent uploads, |
| // in reverse chronological order. |
| // Must be called only after OnUploadListAvailable has been called. |
| - void GetUploads(unsigned int max_count, std::vector<UploadInfo>* uploads); |
| + void GetUploads(size_t max_count, std::vector<UploadInfo>* uploads); |
|
Mark Mentovai
2016/03/25 18:26:56
#include <stddef.h> here now (and remove it from u
Robert Sesek
2016/03/25 18:45:56
Done.
|
| protected: |
| virtual ~UploadList(); |
| - // Reads the upload log and stores the entries in |uploads_|. |
| - virtual void LoadUploadList(); |
| - |
| - // Adds |info| to |uploads_|. |
| - void AppendUploadInfo(const UploadInfo& info); |
| - |
| - // Clear |uploads_|. |
| - void ClearUploads(); |
| + // Reads the upload log and stores the entries in |uploads|. |
| + virtual void LoadUploadList(std::vector<UploadInfo>* uploads); |
| private: |
| friend class base::RefCountedThreadSafe<UploadList>; |
| - FRIEND_TEST_ALL_PREFIXES(UploadListTest, ParseUploadTimeUploadId); |
| - FRIEND_TEST_ALL_PREFIXES(UploadListTest, ParseUploadTimeUploadIdLocalId); |
| - FRIEND_TEST_ALL_PREFIXES(UploadListTest, ParseUploadTimeUploadIdCaptureTime); |
| - FRIEND_TEST_ALL_PREFIXES(UploadListTest, ParseLocalIdCaptureTime); |
| - FRIEND_TEST_ALL_PREFIXES(UploadListTest, |
| - ParseUploadTimeUploadIdLocalIdCaptureTime); |
| - FRIEND_TEST_ALL_PREFIXES(UploadListTest, ParseMultipleEntries); |
| // Manages the background thread work for LoadUploadListAsynchronously(). |
| - void LoadUploadListAndInformDelegateOfCompletion( |
| + void PerformLoadAndNotifyDelegate( |
| const scoped_refptr<base::SequencedTaskRunner>& task_runner); |
| - // Calls the delegate's callback method, if there is a delegate. |
| - void InformDelegateOfCompletion(); |
| + // Calls the delegate's callback method, if there is a delegate. Stores |
| + // the newly loaded |uploads| into |uploads_| on the delegate's task runner. |
| + void SetUploadsAndNotifyDelegate(std::vector<UploadInfo> uploads); |
| // Parses upload log lines, converting them to UploadInfo entries. |
| - void ParseLogEntries(const std::vector<std::string>& log_entries); |
| + void ParseLogEntries(const std::vector<std::string>& log_entries, |
| + std::vector<UploadInfo>* uploads); |
| + // |thread_checker_| ensures that |uploads_| is only set from the task runner |
| + // that created the UploadList. |
| + base::ThreadChecker thread_checker_; |
| std::vector<UploadInfo> uploads_; |
| Delegate* delegate_; |
| + |
| const base::FilePath upload_log_path_; |
| - base::ThreadChecker thread_checker_; |
| scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| DISALLOW_COPY_AND_ASSIGN(UploadList); |