-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[privacy_budget] Reset state on UKM client ID change.
The set of selected surfaces should be considered itself identifiable. Hence should not be persisted across a UKM client ID change. This change introduces the following: * A new method for MetricsProvider that a metrics service can use to signal that the metrics ID has changed. * A PrivacyBudgetMetricsProvider that updates the IdentifiabilityStudyState in response to client ID changes. (cherry picked from commit e2dcd57) Bug: 973801 Fixed: 1181084 Change-Id: Idaf436b46b29b0a5b349ae1be5970206a66a926f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2710529 Commit-Queue: Asanka Herath <asanka@chromium.org> Reviewed-by: Caitlin Fischer <caitlinfischer@google.com> Reviewed-by: Robert Kaplow <rkaplow@chromium.org> Reviewed-by: Maksim Orlovich <morlovich@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#858279} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2738719 Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Asanka Herath <asanka@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/branch-heads/4430@{#197} Cr-Branched-From: e5ce7dc-refs/heads/master@{#857950}
- Loading branch information
Showing
18 changed files
with
417 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
chrome/browser/privacy_budget/inspectable_identifiability_study_state.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_PRIVACY_BUDGET_INSPECTABLE_IDENTIFIABILITY_STUDY_STATE_H_ | ||
#define CHROME_BROWSER_PRIVACY_BUDGET_INSPECTABLE_IDENTIFIABILITY_STUDY_STATE_H_ | ||
|
||
#include "chrome/browser/privacy_budget/identifiability_study_state.h" | ||
|
||
namespace test_utils { | ||
|
||
// This class is a friend of IdentifiabilityStudyState and can reach into the | ||
// internals. Use this as a last resort. | ||
class InspectableIdentifiabilityStudyState : public IdentifiabilityStudyState { | ||
public: | ||
using IdentifiabilityStudyState::IdentifiableSurfaceSet; | ||
using IdentifiabilityStudyState::IdentifiableSurfaceTypeSet; | ||
|
||
explicit InspectableIdentifiabilityStudyState(PrefService* pref_service) | ||
: IdentifiabilityStudyState(pref_service) {} | ||
|
||
const IdentifiableSurfaceSet& active_surfaces() const { | ||
return active_surfaces_; | ||
} | ||
const IdentifiableSurfaceSet& retired_surfaces() const { | ||
return retired_surfaces_; | ||
} | ||
int max_active_surfaces() const { return max_active_surfaces_; } | ||
int surface_selection_rate() const { return surface_selection_rate_; } | ||
uint64_t prng_seed() const { return prng_seed_; } | ||
}; | ||
|
||
} // namespace test_utils | ||
|
||
#endif // CHROME_BROWSER_PRIVACY_BUDGET_INSPECTABLE_IDENTIFIABILITY_STUDY_STATE_H_ |
Oops, something went wrong.