Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: components/upload_list/upload_list.h

Issue 2335193007: Remove explicit usage of SequencedWorkerPool from UploadList. (Closed)
Patch Set: rebase on r417159 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/upload_list/crash_upload_list.cc ('k') | components/upload_list/upload_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/upload_list/upload_list.h
diff --git a/components/upload_list/upload_list.h b/components/upload_list/upload_list.h
index 27e57344186507cd4c36e0fba17b51752a6f0ad7..ebcab5054bb48858288c15406df4400026187884 100644
--- a/components/upload_list/upload_list.h
+++ b/components/upload_list/upload_list.h
@@ -13,12 +13,12 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/threading/thread_checker.h"
+#include "base/sequence_checker.h"
#include "base/time/time.h"
namespace base {
class SequencedTaskRunner;
-class SequencedWorkerPool;
+class TaskRunner;
}
// Loads and parses an upload list text file of the format
@@ -84,7 +84,7 @@ class UploadList : public base::RefCountedThreadSafe<UploadList> {
// Creates a new upload list with the given callback delegate.
UploadList(Delegate* delegate,
const base::FilePath& upload_log_path,
- const scoped_refptr<base::SequencedWorkerPool>& worker_pool);
+ scoped_refptr<base::TaskRunner> task_runner);
// Starts loading the upload list. OnUploadListAvailable will be called when
// loading is complete.
@@ -118,7 +118,7 @@ class UploadList : public base::RefCountedThreadSafe<UploadList> {
// Manages the background thread work for LoadUploadListAsynchronously().
void PerformLoadAndNotifyDelegate(
- const scoped_refptr<base::SequencedTaskRunner>& task_runner);
+ scoped_refptr<base::SequencedTaskRunner> task_runner);
// Calls the delegate's callback method, if there is a delegate. Stores
// the newly loaded |uploads| into |uploads_| on the delegate's task runner.
@@ -128,15 +128,17 @@ class UploadList : public base::RefCountedThreadSafe<UploadList> {
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_;
+ // Ensures that this class' thread unsafe state is only accessed from the
+ // sequence that owns this UploadList.
+ base::SequenceChecker sequence_checker_;
+
std::vector<UploadInfo> uploads_;
+
Delegate* delegate_;
const base::FilePath upload_log_path_;
- scoped_refptr<base::SequencedWorkerPool> worker_pool_;
+ const scoped_refptr<base::TaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(UploadList);
};
« no previous file with comments | « components/upload_list/crash_upload_list.cc ('k') | components/upload_list/upload_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698