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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc

Issue 443793003: [SyncFS] Clear dirty flag on changelist application phase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc
index 6afa05c997c61a6ac1f37d8490dde9a9f6914ac2..38cb6ac2f5e8074922fd74836645a8927b0e49cd 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc
@@ -494,6 +494,36 @@ int64 MetadataDatabaseIndexOnDisk::PickDirtyTracker() const {
return tracker_id;
}
+void MetadataDatabaseIndexOnDisk::EnumerateDirtyTrackers(
+ const TrackerIDCallback& callback) const {
+ scoped_ptr<LevelDBWrapper::Iterator> itr = db_->NewIterator();
+ for (itr->Seek(kDirtyIDKeyPrefix); itr->Valid(); itr->Next()) {
+ std::string id_str;
+ if (!RemovePrefix(itr->key().ToString(), kDirtyIDKeyPrefix, &id_str))
+ break;
+
+ int64 tracker_id = 0;
+ if (!base::StringToInt64(id_str, &tracker_id)) {
+ NOTREACHED();
+ continue;
+ }
+ callback.Run(tracker_id);
+ }
+
+ for (itr->Seek(kDemotedDirtyIDKeyPrefix); itr->Valid(); itr->Next()) {
+ std::string id_str;
+ if (!RemovePrefix(itr->key().ToString(), kDemotedDirtyIDKeyPrefix, &id_str))
+ break;
+
+ int64 tracker_id = 0;
+ if (!base::StringToInt64(id_str, &tracker_id)) {
+ NOTREACHED();
+ continue;
+ }
+ callback.Run(tracker_id);
+ }
+}
+
void MetadataDatabaseIndexOnDisk::DemoteDirtyTracker(int64 tracker_id) {
const std::string key = GenerateDirtyIDKey(tracker_id);

Powered by Google App Engine
This is Rietveld 408576698