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

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

Issue 441873003: [SyncFS] Handlng active tracker ID in TrackerIDSet-style on disk DB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.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_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 096338ad3719a6aacaa9cfb17f6abc6cd3d2c2df..6afa05c997c61a6ac1f37d8490dde9a9f6914ac2 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
@@ -1075,8 +1075,9 @@ void MetadataDatabaseIndexOnDisk::ActivateInTrackerIDSetWithPrefix(
std::string value;
leveldb::Status status = db_->Get(active_tracker_key, &value);
- int64 active_tracker_id;
- if (status.ok() && base::StringToInt64(value, &active_tracker_id)) {
+ int64 active_tracker_id = kInvalidTrackerID;
+ if (status.IsNotFound() ||
+ (status.ok() && base::StringToInt64(value, &active_tracker_id))) {
DCHECK(active_tracker_id != tracker_id);
db_->Put(active_tracker_key, base::Int64ToString(tracker_id));
}
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698