0

Use std::string_view in PrefFilter.

Bug: 349741884
Change-Id: I3d63e6649e767796d39855eb2d8af5e428a3e426
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5666576
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320950}
This commit is contained in:
Jan Keitel
2024-06-28 14:26:43 +00:00
committed by Chromium LUCI CQ
parent 667c35b8b5
commit ff51e2f893
6 changed files with 19 additions and 12 deletions

@ -74,7 +74,7 @@ class InterceptingPrefFilter : public PrefFilter {
// PrefFilter implementation:
void FilterOnLoad(PostFilterOnLoadCallback post_filter_on_load_callback,
base::Value::Dict pref_store_contents) override;
void FilterUpdate(const std::string& path) override {}
void FilterUpdate(std::string_view path) override {}
OnWriteCallbackPair FilterSerializeData(
base::Value::Dict& pref_store_contents) override {
return std::move(on_write_callback_pair_);

@ -5,7 +5,7 @@
#ifndef COMPONENTS_PREFS_PREF_FILTER_H_
#define COMPONENTS_PREFS_PREF_FILTER_H_
#include <string>
#include <string_view>
#include <utility>
#include "base/functional/callback_forward.h"
@ -27,7 +27,7 @@ class COMPONENTS_PREFS_EXPORT PrefFilter {
using PostFilterOnLoadCallback =
base::OnceCallback<void(base::Value::Dict prefs, bool schedule_write)>;
virtual ~PrefFilter() {}
virtual ~PrefFilter() = default;
// This method is given ownership of the |pref_store_contents| read from disk
// before the underlying PersistentPrefStore gets to use them. It must hand
@ -42,7 +42,7 @@ class COMPONENTS_PREFS_EXPORT PrefFilter {
// Receives notification when a pref store value is changed, before Observers
// are notified.
virtual void FilterUpdate(const std::string& path) = 0;
virtual void FilterUpdate(std::string_view path) = 0;
// Receives notification when the pref store is about to serialize data
// contained in |pref_store_contents| to a string. Modifications to