#include "crypto/unexportable_key_metrics.h"
#include <memory>
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/timer/elapsed_timer.h"
#include "crypto/unexportable_key.h"
namespace crypto {
namespace {
enum class KeyType { … };
const SignatureVerifier::SignatureAlgorithm kAllAlgorithms[] = …;
constexpr char kTestKeyName[] = …;
std::string GetHistogramPrefixForKeyType(KeyType type) { … }
std::string GetHistogramSuffixForAlgo(internal::TPMSupport algo) { … }
internal::TPMType GetSupportedTpm(internal::TPMSupport hw,
internal::TPMSupport virt) { … }
void ReportUmaLatency(TPMOperation operation,
internal::TPMSupport algo,
base::TimeDelta latency,
KeyType type = KeyType::kHardwareKey) { … }
void ReportUmaOperationSuccess(TPMOperation operation,
internal::TPMSupport algo,
bool status,
KeyType type = KeyType::kHardwareKey) { … }
void ReportUmaTpmOperation(TPMOperation operation,
internal::TPMSupport algo,
base::TimeDelta latency,
bool status,
KeyType type = KeyType::kHardwareKey) { … }
internal::TPMSupport MeasureVirtualTpmOperations() { … }
void MeasureTpmOperationsInternal(UnexportableKeyProvider::Config config) { … }
}
namespace internal {
void MeasureTpmOperationsInternalForTesting() { … }
}
std::string OperationToString(TPMOperation operation) { … }
std::string AlgorithmToString(SignatureVerifier::SignatureAlgorithm algorithm) { … }
void MaybeMeasureTpmOperations(UnexportableKeyProvider::Config config) { … }
}