Mike Jackson | 82654a3a | 2025-02-13 07:48:22 | [diff] [blame] | 1 | // 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 | |
| 11 | namespace content { |
| 12 | |
| 13 | // Returns the randomized trigger rate with 7 digits of precision. |
| 14 | // The trigger rate returned will be between 0 and 1. |
| 15 | CONTENT_EXPORT double GetConfidenceRandomizedTriggerRate(); |
| 16 | |
| 17 | // Returns a local differentially private confidence value. |
| 18 | // The `randomizedTriggerRate` determines how much noise is added. |
| 19 | CONTENT_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_ |