Remove foreign keys from PrefRegistry.
This is dead code - foreign keys are no longer used. Change-Id: I75890036a8402b5b2e70942e8d8b12cc7edd7e21 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5679108 Auto-Submit: Jan Keitel <jkeitel@google.com> Reviewed-by: Dominic Battré <battre@chromium.org> Commit-Queue: Dominic Battré <battre@chromium.org> Cr-Commit-Position: refs/heads/main@{#1324937}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
973fb00a12
commit
7ef925c836
components
@ -59,7 +59,6 @@ scoped_refptr<PrefRegistrySyncable> PrefRegistrySyncable::ForkForIncognito() {
|
|||||||
scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable());
|
scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable());
|
||||||
registry->defaults_ = defaults_;
|
registry->defaults_ = defaults_;
|
||||||
registry->registration_flags_ = registration_flags_;
|
registry->registration_flags_ = registration_flags_;
|
||||||
registry->foreign_pref_keys_ = foreign_pref_keys_;
|
|
||||||
return registry;
|
return registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,14 +50,6 @@ void PrefRegistry::SetDefaultPrefValue(const std::string& pref_name,
|
|||||||
defaults_->ReplaceDefaultValue(pref_name, std::move(value));
|
defaults_->ReplaceDefaultValue(pref_name, std::move(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrefRegistry::SetDefaultForeignPrefValue(const std::string& path,
|
|
||||||
base::Value default_value,
|
|
||||||
uint32_t flags) {
|
|
||||||
auto erased = foreign_pref_keys_.erase(path);
|
|
||||||
DCHECK_EQ(1u, erased);
|
|
||||||
RegisterPreference(path, std::move(default_value), flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrefRegistry::RegisterPreference(std::string_view path,
|
void PrefRegistry::RegisterPreference(std::string_view path,
|
||||||
base::Value default_value,
|
base::Value default_value,
|
||||||
uint32_t flags) {
|
uint32_t flags) {
|
||||||
@ -78,9 +70,4 @@ void PrefRegistry::RegisterPreference(std::string_view path,
|
|||||||
OnPrefRegistered(path, flags);
|
OnPrefRegistered(path, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrefRegistry::RegisterForeignPref(const std::string& path) {
|
|
||||||
bool inserted = foreign_pref_keys_.insert(path).second;
|
|
||||||
DCHECK(inserted);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrefRegistry::OnPrefRegistered(std::string_view path, uint32_t flags) {}
|
void PrefRegistry::OnPrefRegistered(std::string_view path, uint32_t flags) {}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
@ -77,20 +76,6 @@ class COMPONENTS_PREFS_EXPORT PrefRegistry
|
|||||||
// `pref_name` must be a previously registered preference.
|
// `pref_name` must be a previously registered preference.
|
||||||
void SetDefaultPrefValue(const std::string& pref_name, base::Value value);
|
void SetDefaultPrefValue(const std::string& pref_name, base::Value value);
|
||||||
|
|
||||||
// Registers a pref owned by another service for use with the current service.
|
|
||||||
// The owning service must register that pref with the `PUBLIC` flag.
|
|
||||||
void RegisterForeignPref(const std::string& path);
|
|
||||||
|
|
||||||
// Sets the default value and flags of a previously-registered foreign pref
|
|
||||||
// value.
|
|
||||||
void SetDefaultForeignPrefValue(const std::string& path,
|
|
||||||
base::Value default_value,
|
|
||||||
uint32_t flags);
|
|
||||||
|
|
||||||
const std::set<std::string>& foreign_pref_keys() const {
|
|
||||||
return foreign_pref_keys_;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class base::RefCounted<PrefRegistry>;
|
friend class base::RefCounted<PrefRegistry>;
|
||||||
virtual ~PrefRegistry();
|
virtual ~PrefRegistry();
|
||||||
@ -108,8 +93,6 @@ class COMPONENTS_PREFS_EXPORT PrefRegistry
|
|||||||
|
|
||||||
// A map of pref name to a bitmask of PrefRegistrationFlags.
|
// A map of pref name to a bitmask of PrefRegistrationFlags.
|
||||||
PrefRegistrationFlagsMap registration_flags_;
|
PrefRegistrationFlagsMap registration_flags_;
|
||||||
|
|
||||||
std::set<std::string> foreign_pref_keys_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COMPONENTS_PREFS_PREF_REGISTRY_H_
|
#endif // COMPONENTS_PREFS_PREF_REGISTRY_H_
|
||||||
|
Reference in New Issue
Block a user