| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // If the tracker has no further change to sync, unmarks its dirty flag. | 266 // If the tracker has no further change to sync, unmarks its dirty flag. |
| 267 void PopulateFolderByChildList(const std::string& folder_id, | 267 void PopulateFolderByChildList(const std::string& folder_id, |
| 268 const FileIDList& child_file_ids, | 268 const FileIDList& child_file_ids, |
| 269 const SyncStatusCallback& callback); | 269 const SyncStatusCallback& callback); |
| 270 | 270 |
| 271 // Updates |synced_details| of the tracker with |updated_details|. | 271 // Updates |synced_details| of the tracker with |updated_details|. |
| 272 void UpdateTracker(int64 tracker_id, | 272 void UpdateTracker(int64 tracker_id, |
| 273 const FileDetails& updated_details, | 273 const FileDetails& updated_details, |
| 274 const SyncStatusCallback& callback); | 274 const SyncStatusCallback& callback); |
| 275 | 275 |
| 276 // Returns true if the tracker can be safely activated without deactivating |
| 277 // any other trackers. In this case, tries to activate the tracker, and |
| 278 // invokes |callback| upon completion. |
| 279 // Returns false otherwise. In false case, |callback| will not be invoked. |
| 280 bool TryNoSideEffectActivation(int64 tracker_id, |
| 281 const SyncStatusCallback& callback); |
| 282 |
| 276 // Changes the priority of the tracker to low. | 283 // Changes the priority of the tracker to low. |
| 277 void LowerTrackerPriority(int64 tracker_id); | 284 void LowerTrackerPriority(int64 tracker_id); |
| 278 void PromoteLowerPriorityTrackersToNormal(); | 285 void PromoteLowerPriorityTrackersToNormal(); |
| 279 | 286 |
| 280 // Returns true if there is a normal priority dirty tracker. | 287 // Returns true if there is a normal priority dirty tracker. |
| 281 // Assigns the dirty tracker if exists and |tracker| is non-NULL. | 288 // Assigns the dirty tracker if exists and |tracker| is non-NULL. |
| 282 bool GetNormalPriorityDirtyTracker(FileTracker* tracker) const; | 289 bool GetNormalPriorityDirtyTracker(FileTracker* tracker) const; |
| 283 | 290 |
| 284 // Returns true if there is a low priority dirty tracker. | 291 // Returns true if there is a low priority dirty tracker. |
| 285 // Assigns the dirty tracker if exists and |tracker| is non-NULL. | 292 // Assigns the dirty tracker if exists and |tracker| is non-NULL. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 430 |
| 424 base::WeakPtrFactory<MetadataDatabase> weak_ptr_factory_; | 431 base::WeakPtrFactory<MetadataDatabase> weak_ptr_factory_; |
| 425 | 432 |
| 426 DISALLOW_COPY_AND_ASSIGN(MetadataDatabase); | 433 DISALLOW_COPY_AND_ASSIGN(MetadataDatabase); |
| 427 }; | 434 }; |
| 428 | 435 |
| 429 } // namespace drive_backend | 436 } // namespace drive_backend |
| 430 } // namespace sync_file_system | 437 } // namespace sync_file_system |
| 431 | 438 |
| 432 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ | 439 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
| OLD | NEW |