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

Unified Diff: components/reading_list/ios/reading_list_store.cc

Issue 2623723002: [Sync] Remove ModelError::IsSet() in favor of base::Optional. (Closed)
Patch Set: Rebase. Created 3 years, 11 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: components/reading_list/ios/reading_list_store.cc
diff --git a/components/reading_list/ios/reading_list_store.cc b/components/reading_list/ios/reading_list_store.cc
index 4be2da2ea22cfbe9f8a8d626e23a74c63f47af9c..528bcab51372967c450017b1bfc05b99a269c5b1 100644
--- a/components/reading_list/ios/reading_list_store.cc
+++ b/components/reading_list/ios/reading_list_store.cc
@@ -150,10 +150,10 @@ void ReadingListStore::OnDatabaseLoad(
}
void ReadingListStore::OnReadAllMetadata(
- syncer::ModelError error,
+ base::Optional<syncer::ModelError> error,
std::unique_ptr<syncer::MetadataBatch> metadata_batch) {
DCHECK(CalledOnValidThread());
- if (error.IsSet()) {
+ if (error) {
change_processor()->ReportError(FROM_HERE, "Failed to read metadata.");
} else {
change_processor()->OnMetadataLoaded(std::move(metadata_batch));
@@ -198,7 +198,7 @@ ReadingListStore::CreateMetadataChangeList() {
// combine all change atomically, should save the metadata after the data
// changes, so that this merge will be re-driven by sync if is not completely
// saved during the current run.
-syncer::ModelError ReadingListStore::MergeSyncData(
+base::Optional<syncer::ModelError> ReadingListStore::MergeSyncData(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityDataMap entity_data_map) {
DCHECK(CalledOnValidThread());
@@ -277,7 +277,7 @@ syncer::ModelError ReadingListStore::MergeSyncData(
}
batch_->TransferMetadataChanges(std::move(metadata_change_list));
- return syncer::ModelError();
+ return {};
}
// Apply changes from the sync server locally.
@@ -285,7 +285,7 @@ syncer::ModelError ReadingListStore::MergeSyncData(
// |metadata_change_list| in case when some of the data changes are filtered
// out, or even be empty in case when a commit confirmation is processed and
// only the metadata needs to persisted.
-syncer::ModelError ReadingListStore::ApplySyncChanges(
+base::Optional<syncer::ModelError> ReadingListStore::ApplySyncChanges(
std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
syncer::EntityChangeList entity_changes) {
DCHECK(CalledOnValidThread());
@@ -347,7 +347,7 @@ syncer::ModelError ReadingListStore::ApplySyncChanges(
}
batch_->TransferMetadataChanges(std::move(metadata_change_list));
- return syncer::ModelError();
+ return {};
}
void ReadingListStore::GetData(StorageKeyList storage_keys,

Powered by Google App Engine
This is Rietveld 408576698