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

Unified Diff: chrome/browser/sync_file_system/local/syncable_file_operation_runner.h

Issue 2129083002: Explicitly check various sync_file_system classes live on the IO thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests, remove unneeded check Created 4 years, 5 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
Index: chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
index 9db926413ad5876810f517f7a7a624a714cd4e28..cadbf89c573cb7d03acb0dd40448dad35633b762 100644
--- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
+++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h
@@ -14,7 +14,6 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "base/threading/non_thread_safe.h"
#include "chrome/browser/sync_file_system/local/local_file_sync_status.h"
#include "storage/browser/fileapi/file_system_url.h"
@@ -27,8 +26,7 @@ namespace sync_file_system {
// This class must run only on IO thread.
// Owned by LocalFileSyncContext.
class SyncableFileOperationRunner
- : public base::NonThreadSafe,
- public base::SupportsWeakPtr<SyncableFileOperationRunner>,
+ : public base::SupportsWeakPtr<SyncableFileOperationRunner>,
public LocalFileSyncStatus::Observer {
public:
// Represents an operation task (which usually wraps one FileSystemOperation).
@@ -49,7 +47,6 @@ class SyncableFileOperationRunner
friend class SyncableFileOperationRunner;
bool IsRunnable(LocalFileSyncStatus* status) const;
void Start(LocalFileSyncStatus* status);
- static void CancelAndDelete(Task* task);
DISALLOW_COPY_AND_ASSIGN(Task);
};
@@ -91,9 +88,9 @@ class SyncableFileOperationRunner
bool ShouldStartMoreTasks() const;
// Keeps track of the writing/syncing status. Not owned.
- LocalFileSyncStatus* sync_status_;
+ LocalFileSyncStatus* const sync_status_;
- std::list<Task*> pending_tasks_;
+ std::list<std::unique_ptr<Task>> pending_tasks_;
const int64_t max_inflight_tasks_;
int64_t num_inflight_tasks_;

Powered by Google App Engine
This is Rietveld 408576698