From 680e0639e8fb367dc4c9dcb6245cd2b5d938652d Mon Sep 17 00:00:00 2001 From: Ankush Singh Date: Mon, 13 Mar 2023 10:27:10 +0000 Subject: [PATCH] [sync] Mark GetSyncablePrefsDatabase() as pure virtual This CL wraps up a TODO to mark PrefModelAssociatorClient::GetSyncablePrefsDatabase() as pure virtual since all implementations have implemented it. Bug: 1401271 Change-Id: I0f7538d508e88b3de4cff7055af3f3232fb3fb91 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4324042 Commit-Queue: Ankush Singh Reviewed-by: Marc Treib Cr-Commit-Position: refs/heads/main@{#1116296} --- .../pref_model_associator_client.cc | 21 ------------------- .../pref_model_associator_client.h | 4 +--- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/components/sync_preferences/pref_model_associator_client.cc b/components/sync_preferences/pref_model_associator_client.cc index c5a4bc375dcc56..f500bfe313d7c0 100644 --- a/components/sync_preferences/pref_model_associator_client.cc +++ b/components/sync_preferences/pref_model_associator_client.cc @@ -3,24 +3,3 @@ // found in the LICENSE file. #include "components/sync_preferences/pref_model_associator_client.h" -#include "components/sync_preferences/syncable_prefs_database.h" - -namespace sync_preferences { -namespace { -// TODO(crbug.com/1401271): Remove this class once GetSyncablePrefsDatabase() -// is marked as pure virtual. -class DummySyncablePrefsDatabase : public SyncablePrefsDatabase { - public: - bool IsPreferenceSyncable(const std::string& /*pref_name*/) const override { - return true; - } -}; -} // namespace - -const SyncablePrefsDatabase& -PrefModelAssociatorClient::GetSyncablePrefsDatabase() const { - static const DummySyncablePrefsDatabase syncable_prefs_database; - return syncable_prefs_database; -} - -} // namespace sync_preferences diff --git a/components/sync_preferences/pref_model_associator_client.h b/components/sync_preferences/pref_model_associator_client.h index daf3473a16f0ca..5c96178ac19bce 100644 --- a/components/sync_preferences/pref_model_associator_client.h +++ b/components/sync_preferences/pref_model_associator_client.h @@ -43,9 +43,7 @@ class PrefModelAssociatorClient { // Returns a pointer to the instance of SyncablePrefsDatabase. This should // define the list of syncable preferences. - // TODO(crbug.com/1401271): Mark this method as pure virtual once - // platform-specific implementations are complete. - virtual const SyncablePrefsDatabase& GetSyncablePrefsDatabase() const; + virtual const SyncablePrefsDatabase& GetSyncablePrefsDatabase() const = 0; protected: PrefModelAssociatorClient() {}