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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc

Issue 881203003: Suppress sequence checks in SyncFileSystem on the shutdown phase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +param comment Created 5 years, 11 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/drive_backend/sync_task_manager.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
index d6ecbae566798c7639729b29cb39acfbae907ac4..16e1f9bf53804206a0503fd3ff7820d2a9fb8695 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
@@ -55,12 +55,14 @@ bool SyncTaskManager::PendingTaskComparator::operator()(
SyncTaskManager::SyncTaskManager(
base::WeakPtr<Client> client,
size_t maximum_background_task,
- const scoped_refptr<base::SequencedTaskRunner>& task_runner)
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner,
+ const scoped_refptr<base::SequencedWorkerPool>& worker_pool)
: client_(client),
maximum_background_task_(maximum_background_task),
pending_task_seq_(0),
task_token_seq_(SyncTaskToken::kMinimumBackgroundTaskTokenID),
task_runner_(task_runner),
+ worker_pool_(worker_pool),
weak_ptr_factory_(this) {
}
@@ -204,6 +206,10 @@ void SyncTaskManager::DetachFromSequence() {
sequence_checker_.DetachFromSequence();
}
+bool SyncTaskManager::ShouldTrackTaskToken() const {
+ return !worker_pool_ || !worker_pool_->IsShutdownInProgress();
+}
+
void SyncTaskManager::NotifyTaskDoneBody(scoped_ptr<SyncTaskToken> token,
SyncStatusCode status) {
DCHECK(sequence_checker_.CalledOnValidSequencedThread());

Powered by Google App Engine
This is Rietveld 408576698