blob: 20a49c1e0024526334e6c4a5357d7baa904d1f2f [file] [log] [blame]
Mike Jackson82654a3a2025-02-13 07:48:221// Copyright 2025 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_RENDERER_HOST_RANDOMIZED_CONFIDENCE_UTILS_H_
6#define CONTENT_BROWSER_RENDERER_HOST_RANDOMIZED_CONFIDENCE_UTILS_H_
7
8#include "content/common/content_export.h"
9#include "third_party/blink/public/mojom/confidence_level.mojom.h"
10
11namespace content {
12
13// Returns the randomized trigger rate with 7 digits of precision.
14// The trigger rate returned will be between 0 and 1.
15CONTENT_EXPORT double GetConfidenceRandomizedTriggerRate();
16
17// Returns a local differentially private confidence value.
18// The `randomizedTriggerRate` determines how much noise is added.
19CONTENT_EXPORT blink::mojom::ConfidenceLevel GenerateRandomizedConfidenceLevel(
20 double randomizedTriggerRate,
21 blink::mojom::ConfidenceLevel confidence);
22
23} // namespace content
24
25#endif // CONTENT_BROWSER_RENDERER_HOST_RANDOMIZED_CONFIDENCE_UTILS_H_