Kevin McNee | 842eb0a | 2024-04-11 20:14:16 | [diff] [blame] | 1 | // Copyright 2024 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_PRELOADING_PRELOADING_CONFIDENCE_H_ |
| 6 | #define CONTENT_BROWSER_PRELOADING_PRELOADING_CONFIDENCE_H_ |
| 7 | |
| 8 | #include "base/check_op.h" |
| 9 | #include "base/types/strong_alias.h" |
| 10 | |
| 11 | namespace content { |
| 12 | |
| 13 | // The confidence percentage of a predictor's preloading prediction. The range |
| 14 | // is [0, 100]. |
| 15 | class PreloadingConfidence |
| 16 | : public base::StrongAlias<class PreloadingConfidenceTag, int> { |
| 17 | public: |
| 18 | constexpr explicit PreloadingConfidence(int confidence) |
| 19 | : base::StrongAlias<class PreloadingConfidenceTag, int>(confidence) { |
| 20 | CHECK_GE(confidence, 0); |
| 21 | CHECK_LE(confidence, 100); |
| 22 | } |
| 23 | }; |
| 24 | |
| 25 | } // namespace content |
| 26 | |
| 27 | #endif // CONTENT_BROWSER_PRELOADING_PRELOADING_CONFIDENCE_H_ |