OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync_file_system/drive_backend/sync_worker.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_worker.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "chrome/browser/drive/drive_service_interface.h" | 10 #include "chrome/browser/drive/drive_service_interface.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 observers_, | 227 observers_, |
228 UpdateServiceState( | 228 UpdateServiceState( |
229 GetCurrentState(), | 229 GetCurrentState(), |
230 enabled ? "Sync is enabled" : "Sync is disabled")); | 230 enabled ? "Sync is enabled" : "Sync is disabled")); |
231 } | 231 } |
232 | 232 |
233 void SyncWorker::PromoteDemotedChanges(const base::Closure& callback) { | 233 void SyncWorker::PromoteDemotedChanges(const base::Closure& callback) { |
234 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 234 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
235 | 235 |
236 MetadataDatabase* metadata_db = GetMetadataDatabase(); | 236 MetadataDatabase* metadata_db = GetMetadataDatabase(); |
237 if (metadata_db && metadata_db->HasLowPriorityDirtyTracker()) { | 237 if (metadata_db && metadata_db->HasDemotedDirtyTracker()) { |
238 metadata_db->PromoteLowerPriorityTrackersToNormal(); | 238 metadata_db->PromoteDemotedTrackers(); |
239 FOR_EACH_OBSERVER( | 239 FOR_EACH_OBSERVER( |
240 Observer, | 240 Observer, |
241 observers_, | 241 observers_, |
242 OnPendingFileListUpdated(metadata_db->CountDirtyTracker())); | 242 OnPendingFileListUpdated(metadata_db->CountDirtyTracker())); |
243 } | 243 } |
244 callback.Run(); | 244 callback.Run(); |
245 } | 245 } |
246 | 246 |
247 void SyncWorker::ApplyLocalChange(const FileChange& local_change, | 247 void SyncWorker::ApplyLocalChange(const FileChange& local_change, |
248 const base::FilePath& local_path, | 248 const base::FilePath& local_path, |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 return context_->GetDriveUploader(); | 711 return context_->GetDriveUploader(); |
712 } | 712 } |
713 | 713 |
714 MetadataDatabase* SyncWorker::GetMetadataDatabase() { | 714 MetadataDatabase* SyncWorker::GetMetadataDatabase() { |
715 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 715 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
716 return context_->GetMetadataDatabase(); | 716 return context_->GetMetadataDatabase(); |
717 } | 717 } |
718 | 718 |
719 } // namespace drive_backend | 719 } // namespace drive_backend |
720 } // namespace sync_file_system | 720 } // namespace sync_file_system |
OLD | NEW |