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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_database.h

Issue 148483009: [SyncFS] Force activate folder tracker on folder creation conflict case (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/metadata_database.h
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.h b/chrome/browser/sync_file_system/drive_backend/metadata_database.h
index 5cd673cc9f3a8222eb7c78815d91c8b3860e9359..39df98ff4bb6e79eeef9d66dfa70940db78ea33b 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database.h
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.h
@@ -125,7 +125,6 @@ class MetadataDatabase {
enum ActivationStatus {
ACTIVATION_PENDING,
ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER,
- ACTIVATION_FAILED_SAME_PATH_TRACKER,
};
enum UpdateOption {
@@ -304,18 +303,22 @@ class MetadataDatabase {
const FileDetails& updated_details,
const SyncStatusCallback& callback);
- // Returns ACTIVATION_PENDING if a tracker of the file can be safely activated
- // without deactivating any other trackers. In this case, tries to activate
- // the tracker, and invokes |callback| upon completion.
- // Returns ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER if there's another active
- // tracker that tracks |file_id|.
- // Returns ACTIVATION_FAILED_SAME_PATH_TRACKER if there's another active
- // tracker that has the same parent tracker and title to |file_id|.
- // In these FAILED cases, |callback| is not invoked.
- ActivationStatus TryNoSideEffectActivation(
- int64 parent_tracker_id,
- const std::string& file_id,
- const SyncStatusCallback& callback);
+ // Activates a tracker identified by |parent_tracker_id| and |file_id| if the
+ // tracker can be activated without inactivating other trackers that has the
kinuko 2014/02/07 08:00:21 nit: has -> have
tzik 2014/02/10 02:38:58 Done.
+ // same |file_id| but a different path.
kinuko 2014/02/07 08:00:21 a different path -> different paths
tzik 2014/02/10 02:38:58 Done.
+ // If |file_id| has another active tracker, the function returns
+ // ACTIVATION_FAILED_ANOTHER_ACTIVE_TRACKER and does not invoke |callback|.
+ // If there is another active tracker that has the same path but different
+ // |file_id|, inactivates the tracker.
+ // In success case, returns ACTIVATION_PENDING and invokes |callback| upon
+ // completion.
+ //
+ // The tracker to be activated must:
+ // - have a tracked metadata in the database,
+ // - have |synced_details| with valid |title|.
+ ActivationStatus TryActivateTracker(int64 parent_tracker_id,
+ const std::string& file_id,
+ const SyncStatusCallback& callback);
// Changes the priority of the tracker to low.
void LowerTrackerPriority(int64 tracker_id);

Powered by Google App Engine
This is Rietveld 408576698