Chromium Code Reviews| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 typedef std::map<std::string, FileTracker*> TrackerByAppID; | 118 typedef std::map<std::string, FileTracker*> TrackerByAppID; |
| 119 typedef std::vector<std::string> FileIDList; | 119 typedef std::vector<std::string> FileIDList; |
| 120 | 120 |
| 121 typedef base::Callback< | 121 typedef base::Callback< |
| 122 void(SyncStatusCode status, scoped_ptr<MetadataDatabase> instance)> | 122 void(SyncStatusCode status, scoped_ptr<MetadataDatabase> instance)> |
| 123 CreateCallback; | 123 CreateCallback; |
| 124 | 124 |
| 125 enum ActivationStatus { | 125 enum ActivationStatus { |
| 126 ACTIVATION_PENDING, | 126 ACTIVATION_PENDING, |
| 127 ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER, | 127 ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER, |
| 128 ACTIVATION_FAILED_SAME_PATH_TRACKER, | |
| 129 }; | 128 }; |
| 130 | 129 |
| 131 enum UpdateOption { | 130 enum UpdateOption { |
| 132 UPDATE_TRACKER_FOR_UNSYNCED_FILE, | 131 UPDATE_TRACKER_FOR_UNSYNCED_FILE, |
| 133 UPDATE_TRACKER_FOR_SYNCED_FILE, | 132 UPDATE_TRACKER_FOR_SYNCED_FILE, |
| 134 }; | 133 }; |
| 135 | 134 |
| 136 // The entry point of the MetadataDatabase for production code. | 135 // The entry point of the MetadataDatabase for production code. |
| 137 // If |env_override| is non-NULL, internal LevelDB uses |env_override| instead | 136 // If |env_override| is non-NULL, internal LevelDB uses |env_override| instead |
| 138 // of leveldb::Env::Default(). Use leveldb::MemEnv in test code for faster | 137 // of leveldb::Env::Default(). Use leveldb::MemEnv in test code for faster |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 void PopulateFolderByChildList(const std::string& folder_id, | 297 void PopulateFolderByChildList(const std::string& folder_id, |
| 299 const FileIDList& child_file_ids, | 298 const FileIDList& child_file_ids, |
| 300 const SyncStatusCallback& callback); | 299 const SyncStatusCallback& callback); |
| 301 | 300 |
| 302 // Updates |synced_details| of the tracker with |updated_details|. | 301 // Updates |synced_details| of the tracker with |updated_details|. |
| 303 void UpdateTracker(int64 tracker_id, | 302 void UpdateTracker(int64 tracker_id, |
| 304 const FileDetails& updated_details, | 303 const FileDetails& updated_details, |
| 305 const SyncStatusCallback& callback); | 304 const SyncStatusCallback& callback); |
| 306 | 305 |
| 307 // Returns ACTIVATION_PENDING if a tracker of the file can be safely activated | 306 // Returns ACTIVATION_PENDING if a tracker of the file can be safely activated |
| 308 // without deactivating any other trackers. In this case, tries to activate | 307 // without deactivating any other path trackers. In this case, tries to |
|
kinuko
2014/02/06 09:48:01
We never used the term 'path tracker', it's bit un
tzik
2014/02/07 04:43:53
Revised these comment.
| |
| 309 // the tracker, and invokes |callback| upon completion. | 308 // activate the tracker, and invokes |callback| upon completion. |
| 310 // Returns ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER if there's another active | 309 // Returns ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER if there's another active |
| 311 // tracker that tracks |file_id|. | 310 // tracker that tracks |file_id|. |
| 312 // Returns ACTIVATION_FAILED_SAME_PATH_TRACKER if there's another active | 311 // In the FAILED case, |callback| is not invoked. |
|
kinuko
2014/02/06 09:48:01
nit/suggestion: remove the line-break at the end o
tzik
2014/02/07 04:43:53
Done.
| |
| 313 // tracker that has the same parent tracker and title to |file_id|. | |
| 314 // In these FAILED cases, |callback| is not invoked. | |
| 315 ActivationStatus TryNoSideEffectActivation( | 312 ActivationStatus TryNoSideEffectActivation( |
|
nhiroki
2014/02/06 10:02:42
Can we reconsider this function name? In a specifi
tzik
2014/02/07 04:43:53
Done.
| |
| 316 int64 parent_tracker_id, | 313 int64 parent_tracker_id, |
| 317 const std::string& file_id, | 314 const std::string& file_id, |
| 318 const SyncStatusCallback& callback); | 315 const SyncStatusCallback& callback); |
| 319 | 316 |
| 320 // Changes the priority of the tracker to low. | 317 // Changes the priority of the tracker to low. |
| 321 void LowerTrackerPriority(int64 tracker_id); | 318 void LowerTrackerPriority(int64 tracker_id); |
| 322 void PromoteLowerPriorityTrackersToNormal(); | 319 void PromoteLowerPriorityTrackersToNormal(); |
| 323 | 320 |
| 324 // Returns true if there is a normal priority dirty tracker. | 321 // Returns true if there is a normal priority dirty tracker. |
| 325 // Assigns the dirty tracker if exists and |tracker| is non-NULL. | 322 // Assigns the dirty tracker if exists and |tracker| is non-NULL. |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 | 499 |
| 503 base::WeakPtrFactory<MetadataDatabase> weak_ptr_factory_; | 500 base::WeakPtrFactory<MetadataDatabase> weak_ptr_factory_; |
| 504 | 501 |
| 505 DISALLOW_COPY_AND_ASSIGN(MetadataDatabase); | 502 DISALLOW_COPY_AND_ASSIGN(MetadataDatabase); |
| 506 }; | 503 }; |
| 507 | 504 |
| 508 } // namespace drive_backend | 505 } // namespace drive_backend |
| 509 } // namespace sync_file_system | 506 } // namespace sync_file_system |
| 510 | 507 |
| 511 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ | 508 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ |
| OLD | NEW |