Index: chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h |
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h |
index ff0ee9bbe8a8ed4587e5e3b84b2c42158666efac..df44df70d3882d0f5eae4942498e3a40edda1f79 100644 |
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h |
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h |
@@ -99,7 +99,43 @@ class MetadataDatabaseIndexOnDisk : public MetadataDatabaseIndexInterface { |
// Returns a TrackerIDSet built from IDs which are found with given key |
// and key prefix. |
TrackerIDSet GetTrackerIDSetByPrefix( |
- const std::string& active_key, const std::string& key_prefix) const; |
+ const std::string& active_tracker_key, |
+ const std::string& key_prefix) const; |
+ |
+ |
+ // Simulate behavior of TrackerIDSet class. |
+ |
+ // Adds an entry with |key_prefix| and tracker ID of |tracker|. If |tracker| |
+ // is active, an entry for |active_key| is added. |
+ void AddToTrackerIDSetWithPrefix( |
+ const std::string& active_tracker_key, |
+ const std::string& key_prefix, |
+ const FileTracker& tracker, |
+ leveldb::WriteBatch* batch); |
+ |
+ // Returns true if |tracker_id| is removed successfully. If no other entries |
+ // are stored with |key_prefix|, the entry for |active_key| is also removed. |
+ bool EraseInTrackerIDSetWithPrefix( |
+ const std::string& active_tracker_key, |
+ const std::string& key_prefix, |
+ int64 tracker_id, |
+ leveldb::WriteBatch* batch); |
+ |
+ // Adds an entry for |active_key| on DB, if |tracker_id| has an entry with |
+ // |key_prefix|. |
+ void ActivateInTrackerIDSetWithPrefix( |
+ const std::string& active_tracker_key, |
+ const std::string& key_prefix, |
+ int64 tracker_id, |
+ leveldb::WriteBatch* batch); |
+ |
+ // Removes an entry for |active_key| on DB, if the value of |active_key| key |
+ // is |tracker_id|. |
+ void DeactivateInTrackerIDSetWithPrefix( |
+ const std::string& active_tracker_key, |
+ const std::string& key_prefix, |
+ int64 tracker_id, |
+ leveldb::WriteBatch* batch); |
// Checks if |db_| has an entry whose key is |key|. |
bool DBHasKey(const std::string& key); |