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()); |