webview: migrate metrics to non-backed-up directory. WebView's temporary metrics files were stored in the host app's data directory, which will be backed up by many Android backup agent implementations. This data isn't worth backing up and changes frequently, so we want to avoid this. Introduce a feature flag which defines a new metrics directory under the Android "no-backup" files directory so that the backup agent knows to ignore it, and will migrate existing files to the new location. The migration is set up to be bidirectional: if a client previously had the feature flag enabled but now does not, the files will be moved back, to prevent metrics loss during experimentation. Bug: 331195418 Change-Id: Icc57e0eacc4eae31696a4729295d003d926bf3c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7004435 Commit-Queue: Richard (Torne) Coles <torne@chromium.org> Reviewed-by: Luc Nguyen <lucnguyen@google.com> Reviewed-by: Nate Fischer <ntfschr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1534495} NOKEYCHECK=True GitOrigin-RevId: d8595c0c841f2815073e05851f268019444bc7a1
diff --git a/file_metrics_provider.cc b/file_metrics_provider.cc index 31e1dfe..5e2039a 100644 --- a/file_metrics_provider.cc +++ b/file_metrics_provider.cc
@@ -288,6 +288,9 @@ std::string_view prefs_key) : path(path), type(type), association(association), prefs_key(prefs_key) {} +FileMetricsProvider::Params::Params(const FileMetricsProvider::Params&) = + default; + FileMetricsProvider::Params::~Params() = default; FileMetricsProvider::FileMetricsProvider(PrefService* local_state, bool is_fre)
diff --git a/file_metrics_provider.h b/file_metrics_provider.h index ad16284..5d4e018 100644 --- a/file_metrics_provider.h +++ b/file_metrics_provider.h
@@ -146,6 +146,7 @@ SourceType type, SourceAssociation association, std::string_view prefs_key = std::string_view()); + Params(const Params&); ~Params();