#include "chrome/browser/metrics/usage_scenario/chrome_responsiveness_calculator_delegate.h"
#include "base/check.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/strings/strcat.h"
#include "base/system/sys_info.h"
#include "chrome/browser/metrics/usage_scenario/usage_scenario_data_store.h"
#include "chrome/browser/metrics/usage_scenario/usage_scenario_tracker.h"
namespace {
bool IsChromeUsedInScenario(Scenario scenario) { … }
#if BUILDFLAG(IS_CHROMEOS)
bool IsLowMemory() {
auto available_bytes = base::SysInfo::AmountOfAvailablePhysicalMemory();
auto total_bytes = base::SysInfo::AmountOfPhysicalMemory();
return (available_bytes * 1000 / total_bytes) < 57;
}
#endif
const char* GetSuffixForExtensionCount(size_t extension_count) { … }
}
std::unique_ptr<ChromeResponsivenessCalculatorDelegate>
ChromeResponsivenessCalculatorDelegate::Create() { … }
std::unique_ptr<ChromeResponsivenessCalculatorDelegate>
ChromeResponsivenessCalculatorDelegate::CreateForTesting(
UsageScenarioDataStore* usage_scenario_data_store) { … }
ChromeResponsivenessCalculatorDelegate::
~ChromeResponsivenessCalculatorDelegate() = default;
void ChromeResponsivenessCalculatorDelegate::OnMeasurementIntervalEnded() { … }
void ChromeResponsivenessCalculatorDelegate::OnResponsivenessEmitted(
int num_congested_slices,
int min,
int exclusive_max,
size_t buckets) { … }
ChromeResponsivenessCalculatorDelegate::ChromeResponsivenessCalculatorDelegate(
UsageScenarioDataStore* usage_scenario_data_store)
: … { … }