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

Unified Diff: components/sync/device_info/device_info_sync_bridge.cc

Issue 2489683002: [Sync] Make all ModelTypeStore write methods go through WriteBatch. (Closed)
Patch Set: Address comment. Created 4 years, 1 month 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 | components/sync/device_info/device_info_sync_bridge_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/device_info/device_info_sync_bridge.cc
diff --git a/components/sync/device_info/device_info_sync_bridge.cc b/components/sync/device_info/device_info_sync_bridge.cc
index 714b2d6d722c25e923b110790f959783ebc23267..394fbd6eb2e27174d7010f59d23e956b136c862a 100644
--- a/components/sync/device_info/device_info_sync_bridge.cc
+++ b/components/sync/device_info/device_info_sync_bridge.cc
@@ -244,7 +244,7 @@ void DeviceInfoSyncBridge::DisableSync() {
if (!all_data_.empty()) {
std::unique_ptr<WriteBatch> batch = store_->CreateWriteBatch();
for (const auto& kv : all_data_) {
- store_->DeleteData(batch.get(), kv.first);
+ batch->DeleteData(kv.first);
}
store_->CommitWriteBatch(
std::move(batch),
@@ -299,7 +299,7 @@ void DeviceInfoSyncBridge::StoreSpecifics(
std::unique_ptr<DeviceInfoSpecifics> specifics,
WriteBatch* batch) {
const std::string guid = specifics->cache_guid();
- store_->WriteData(batch, guid, specifics->SerializeAsString());
+ batch->WriteData(guid, specifics->SerializeAsString());
all_data_[guid] = std::move(specifics);
}
@@ -307,7 +307,7 @@ bool DeviceInfoSyncBridge::DeleteSpecifics(const std::string& guid,
WriteBatch* batch) {
ClientIdToSpecifics::const_iterator iter = all_data_.find(guid);
if (iter != all_data_.end()) {
- store_->DeleteData(batch, guid);
+ batch->DeleteData(guid);
all_data_.erase(iter);
return true;
} else {
« no previous file with comments | « no previous file | components/sync/device_info/device_info_sync_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698