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

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

Issue 23288007: [SyncFS] Add MetadataDatabase::UpdateTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fdb8341c0391a12a8ea41a955fd89af5c3bee1b0..e57d583e3ab811902cda55ed638f6e9d7aa8cdbf 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database.h
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.h
@@ -191,9 +191,14 @@ class MetadataDatabase {
// Adds |child_file_ids| to |folder_id| as its children.
// This method affects the active tracker only.
// If the tracker has no further change to sync, unmarks its dirty flag.
- void PopulateFolder(const std::string& folder_id,
- const FileIDList& child_file_ids,
- const SyncStatusCallback& callback);
+ void PopulateFolderByChildList(const std::string& folder_id,
+ const FileIDList& child_file_ids,
+ const SyncStatusCallback& callback);
+
+ // Updates |synced_details| of the tracker with |updated_details|.
+ void UpdateTracker(int64 tracker_id,
+ const FileDetails& updated_details,
+ const SyncStatusCallback& callback);
private:
struct DirtyTrackerComparator {
@@ -233,8 +238,13 @@ class MetadataDatabase {
void CreateTrackerForParentAndFileID(const FileTracker& parent_tracker,
const std::string& file_id,
leveldb::WriteBatch* batch);
+
+ void RemoveTracker(int64 tracker_id, leveldb::WriteBatch* batch);
void RemoveTrackerIgnoringSiblings(int64 tracker_id,
leveldb::WriteBatch* batch);
+ void RemoveTrackerInternal(int64 tracker_id,
+ leveldb::WriteBatch* batch,
+ bool ignoring_siblings);
void MaybeAddTrackersForNewFile(const FileMetadata& file,
leveldb::WriteBatch* batch);
@@ -256,8 +266,18 @@ class MetadataDatabase {
void RecursiveMarkTrackerAsDirty(int64 root_tracker_id,
leveldb::WriteBatch* batch);
+ bool CanActivateTracker(const FileTracker& tracker);
bool ShouldKeepDirty(const FileTracker& tracker) const;
+ bool HasDisabledAppRoot(const FileTracker& tracker) const;
+ bool HasActiveTrackerForFileID(const std::string& file_id) const;
+ bool HasActiveTrackerForPath(int64 parent_tracker,
+ const std::string& title) const;
+
+ void UpdateTrackerTitle(FileTracker* tracker,
+ const std::string& new_title,
+ leveldb::WriteBatch* batch);
+
void WriteToDatabase(scoped_ptr<leveldb::WriteBatch> batch,
const SyncStatusCallback& callback);
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698