Let PrefRegistry::OnPrefRegistered take a std::string_view.
This CL is part of transitioning PrefRegistry to use std::string_view. The CL contains no functional changes and incurs no extra (string) copies in production code. Bug: 348307659 Change-Id: I03e2546cce47f8b286efa708b4555830cabe93ee Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5643972 Reviewed-by: Dominic Battré <battre@chromium.org> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Commit-Queue: Jan Keitel <jkeitel@google.com> Cr-Commit-Position: refs/heads/main@{#1317289}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cf4f59176d
commit
eea1209516
components
pref_registry
prefs
sync_preferences
@ -5,6 +5,8 @@
|
||||
#include "components/prefs/pref_registry.h"
|
||||
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include "base/check_op.h"
|
||||
@ -80,5 +82,4 @@ void PrefRegistry::RegisterForeignPref(const std::string& path) {
|
||||
DCHECK(inserted);
|
||||
}
|
||||
|
||||
void PrefRegistry::OnPrefRegistered(const std::string& path,
|
||||
uint32_t flags) {}
|
||||
void PrefRegistry::OnPrefRegistered(std::string_view path, uint32_t flags) {}
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
@ -100,8 +102,7 @@ class COMPONENTS_PREFS_EXPORT PrefRegistry
|
||||
uint32_t flags);
|
||||
|
||||
// Allows subclasses to hook into pref registration.
|
||||
virtual void OnPrefRegistered(const std::string& path,
|
||||
uint32_t flags);
|
||||
virtual void OnPrefRegistered(std::string_view path, uint32_t flags);
|
||||
|
||||
scoped_refptr<DefaultPrefStore> defaults_;
|
||||
|
||||
|
Reference in New Issue
Block a user