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

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

Issue 436193003: [SyncFS] Rename LevelDBWrapper::Operation not to be confusing (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
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc
index a68d1742c5bcdd18d55cf19c2d5201071754f49f..625b7add740608fd0f1adb2848f4337eaa2b7672 100644
--- a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc
+++ b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc
@@ -93,7 +93,7 @@ leveldb::Slice LevelDBWrapper::Iterator::value() {
if (db_key.compare(map_key) < 0)
return db_iterator_->value();
- DCHECK(map_iterator_->second.first == DB_PUT);
+ DCHECK(map_iterator_->second.first == PUT_OPERATION);
return map_iterator_->second.second;
}
@@ -101,16 +101,16 @@ void LevelDBWrapper::Iterator::AdvanceIterators() {
// Iterator is valid iff any of below holds:
// - |db_itr.key| < |map_itr.key| OR |map_itr| == end()
// - (|db_itr.key| >= |map_itr.key| OR !|db_itr|->IsValid())
- // AND |map_itr.operation| == DB_PUT
+ // AND |map_itr.operation| == PUT_OPERATION
if (map_iterator_ == db_->pending_.end())
return;
while (map_iterator_ != db_->pending_.end() && db_iterator_->Valid()) {
int cmp_key = db_iterator_->key().compare(map_iterator_->first);
- if (cmp_key < 0 || map_iterator_->second.first == DB_PUT)
+ if (cmp_key < 0 || map_iterator_->second.first == PUT_OPERATION)
return;
- // |db_itr.key| >= |map_itr.key| && |map_itr.operation| != DB_PUT
+ // |db_itr.key| >= |map_itr.key| && |map_itr.operation| != PUT_OPERATION
if (cmp_key == 0)
db_iterator_->Next();
++map_iterator_;
@@ -120,7 +120,7 @@ void LevelDBWrapper::Iterator::AdvanceIterators() {
return;
while (map_iterator_ != db_->pending_.end() &&
- map_iterator_->second.first == DB_DELETE)
+ map_iterator_->second.first == DELETE_OPERATION)
++map_iterator_;
}
@@ -136,11 +136,11 @@ LevelDBWrapper::~LevelDBWrapper() {}
void LevelDBWrapper::Put(const std::string& key,
const std::string& value) {
- pending_[key] = Transaction(DB_PUT, value);
+ pending_[key] = Transaction(PUT_OPERATION, value);
}
void LevelDBWrapper::Delete(const std::string& key) {
- pending_[key] = Transaction(DB_DELETE, std::string());
+ pending_[key] = Transaction(DELETE_OPERATION, std::string());
}
leveldb::Status LevelDBWrapper::Get(const std::string& key,
@@ -151,10 +151,10 @@ leveldb::Status LevelDBWrapper::Get(const std::string& key,
const Transaction& transaction = itr->second;
switch (transaction.first) {
- case DB_PUT:
+ case PUT_OPERATION:
*value = transaction.second;
return leveldb::Status();
- case DB_DELETE:
+ case DELETE_OPERATION:
return leveldb::Status::NotFound(leveldb::Slice());
}
NOTREACHED();
@@ -172,10 +172,10 @@ leveldb::Status LevelDBWrapper::Commit() {
const leveldb::Slice key(itr->first);
const Transaction& transaction = itr->second;
switch (transaction.first) {
- case DB_PUT:
+ case PUT_OPERATION:
batch.Put(key, transaction.second);
break;
- case DB_DELETE:
+ case DELETE_OPERATION:
batch.Delete(key);
break;
}
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698