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

Unified Diff: components/history/core/browser/typed_url_sync_metadata_database.cc

Issue 2841653003: [USS] TypedURLSyncMetadataDatabase inherits SyncMetadataStores (Closed)
Patch Set: Created 3 years, 8 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/history/core/browser/typed_url_sync_metadata_database.cc
diff --git a/components/history/core/browser/typed_url_sync_metadata_database.cc b/components/history/core/browser/typed_url_sync_metadata_database.cc
index 6cc6d15774694b330dfcdc653bd0cdb7e459caa4..f0b2ce6ddf35795ceef3f0449fdbe316c368f44b 100644
--- a/components/history/core/browser/typed_url_sync_metadata_database.cc
+++ b/components/history/core/browser/typed_url_sync_metadata_database.cc
@@ -48,8 +48,12 @@ bool TypedURLSyncMetadataDatabase::GetAllSyncMetadata(
}
bool TypedURLSyncMetadataDatabase::UpdateSyncMetadata(
+ syncer::ModelType model_type,
const std::string& storage_key,
const sync_pb::EntityMetadata& metadata) {
+ DCHECK_EQ(model_type, syncer::TYPED_URLS)
+ << "Only the TYPED_URLS model type is supported";
+
int64_t storage_key_int = 0;
if (!base::StringToInt64(storage_key, &storage_key_int)) {
return false;
@@ -64,7 +68,11 @@ bool TypedURLSyncMetadataDatabase::UpdateSyncMetadata(
}
bool TypedURLSyncMetadataDatabase::ClearSyncMetadata(
+ syncer::ModelType model_type,
const std::string& storage_key) {
+ DCHECK_EQ(model_type, syncer::TYPED_URLS)
+ << "Only the TYPED_URLS model type is supported";
+
int64_t storage_key_int = 0;
if (!base::StringToInt64(storage_key, &storage_key_int)) {
return false;
@@ -77,14 +85,20 @@ bool TypedURLSyncMetadataDatabase::ClearSyncMetadata(
}
bool TypedURLSyncMetadataDatabase::UpdateModelTypeState(
+ syncer::ModelType model_type,
const sync_pb::ModelTypeState& model_type_state) {
+ DCHECK_EQ(model_type, syncer::TYPED_URLS)
+ << "Only the TYPED_URLS model type is supported";
DCHECK_GT(GetMetaTable().GetVersionNumber(), 0);
std::string serialized_state = model_type_state.SerializeAsString();
return GetMetaTable().SetValue(kTypedURLModelTypeStateKey, serialized_state);
}
-bool TypedURLSyncMetadataDatabase::ClearModelTypeState() {
+bool TypedURLSyncMetadataDatabase::ClearModelTypeState(
+ syncer::ModelType model_type) {
+ DCHECK_EQ(model_type, syncer::TYPED_URLS)
+ << "Only the TYPED_URLS model type is supported";
DCHECK_GT(GetMetaTable().GetVersionNumber(), 0);
return GetMetaTable().DeleteKey(kTypedURLModelTypeStateKey);
}

Powered by Google App Engine
This is Rietveld 408576698