#include "extensions/browser/api/metrics_private/metrics_private_api.h"
#include <limits.h>
#include <algorithm>
#include <memory>
#include <utility>
#include "base/hash/hash.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/metrics_hashes.h"
#include "base/metrics/statistics_recorder.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/strcat.h"
#include "base/task/single_thread_task_runner.h"
#include "content/public/browser/histogram_fetcher.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/api/metrics_private/metrics_private_delegate.h"
#include "extensions/common/api/metrics_private.h"
namespace extensions {
GetVariationParams;
RecordUserAction;
RecordValue;
RecordBoolean;
RecordEnumerationValue;
RecordSparseValueWithHashMetricName;
RecordSparseValueWithPersistentHash;
RecordSparseValue;
RecordPercentage;
RecordCount;
RecordSmallCount;
RecordMediumCount;
RecordTime;
RecordMediumTime;
RecordLongTime;
namespace {
const size_t kMaxBuckets = …;
constexpr base::TimeDelta kHistogramsRefreshTimeout = …;
}
ExtensionFunction::ResponseAction
MetricsPrivateGetIsCrashReportingEnabledFunction::Run() { … }
ExtensionFunction::ResponseAction MetricsPrivateGetFieldTrialFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateGetVariationParamsFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordUserActionFunction::Run() { … }
void MetricsHistogramHelperFunction::RecordValue(const std::string& name,
base::HistogramType type,
int min,
int max,
size_t buckets,
int sample) { … }
ExtensionFunction::ResponseAction MetricsPrivateRecordValueFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordSparseValueWithHashMetricNameFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordSparseValueWithPersistentHashFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordSparseValueFunction::Run() { … }
ExtensionFunction::ResponseAction MetricsPrivateRecordBooleanFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordEnumerationValueFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordPercentageFunction::Run() { … }
ExtensionFunction::ResponseAction MetricsPrivateRecordCountFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordSmallCountFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordMediumCountFunction::Run() { … }
ExtensionFunction::ResponseAction MetricsPrivateRecordTimeFunction::Run() { … }
ExtensionFunction::ResponseAction
MetricsPrivateRecordMediumTimeFunction::Run() { … }
ExtensionFunction::ResponseAction MetricsPrivateRecordLongTimeFunction::Run() { … }
MetricsPrivateGetHistogramFunction::~MetricsPrivateGetHistogramFunction() =
default;
ExtensionFunction::ResponseAction MetricsPrivateGetHistogramFunction::Run() { … }
void MetricsPrivateGetHistogramFunction::RespondOnHistogramsFetched(
const std::string& name) { … }
ExtensionFunction::ResponseValue
MetricsPrivateGetHistogramFunction::GetHistogram(const std::string& name) { … }
}