0

Opt //components/prefs into unsafe buffers checks.

The CL also fixes the few instances in which unsafe buffer warnings
were emitted.

Bug: 350941334
Change-Id: I5e0338a6f7b4ecb022e9a02555a2182f94e01763
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5676604
Auto-Submit: Jan Keitel <jkeitel@google.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Cr-Commit-Position: refs/heads/main@{#1322813}
This commit is contained in:
Jan Keitel
2024-07-03 15:59:48 +00:00
committed by Chromium LUCI CQ
parent 1ac56bcaed
commit f7cd4baf7b
3 changed files with 4 additions and 3 deletions

@ -77,6 +77,7 @@
+components/discardable_memory
+components/guest_view/
+components/performance_manager
+components/prefs
+components/plus_addresses
-courgette/
-crypto/

@ -393,8 +393,7 @@ TEST(PrefServiceTest, WriteablePrefStoreFlags) {
PrefRegistry::LOSSY_PREF | kCustomRegistrationFlag,
WriteablePrefStore::LOSSY_PREF_WRITE_FLAG}};
for (size_t i = 0; i < std::size(kRegistrationToWriteFlags); ++i) {
RegistrationToWriteFlags entry = kRegistrationToWriteFlags[i];
for (const RegistrationToWriteFlags& entry : kRegistrationToWriteFlags) {
registry->RegisterDictionaryPref(entry.pref_name,
entry.registration_flags);

@ -5,6 +5,7 @@
#ifndef COMPONENTS_PREFS_PREF_VALUE_STORE_H_
#define COMPONENTS_PREFS_PREF_VALUE_STORE_H_
#include <array>
#include <functional>
#include <map>
#include <memory>
@ -262,7 +263,7 @@ class COMPONENTS_PREFS_EXPORT PrefValueStore {
}
// Keeps the PrefStore references in order of precedence.
PrefStoreKeeper pref_stores_[PREF_STORE_TYPE_MAX + 1];
std::array<PrefStoreKeeper, PREF_STORE_TYPE_MAX + 1> pref_stores_;
// Used for generating notifications. This is a weak reference,
// since the notifier is owned by the corresponding PrefService.