#ifndef EXTENSIONS_BROWSER_API_SYSTEM_CPU_CPU_INFO_PROVIDER_H_
#define EXTENSIONS_BROWSER_API_SYSTEM_CPU_CPU_INFO_PROVIDER_H_
#include <vector>
#include "base/lazy_instance.h"
#include "build/build_config.h"
#include "extensions/browser/api/system_info/system_info_provider.h"
#include "extensions/common/api/system_cpu.h"
#if defined(ARCH_CPU_X86_FAMILY)
#include "base/cpu.h"
#endif
namespace extensions {
class CpuInfoProvider : public SystemInfoProvider {
public:
CpuInfoProvider(const CpuInfoProvider&) = delete;
CpuInfoProvider& operator=(const CpuInfoProvider&) = delete;
static CpuInfoProvider* Get();
const api::system_cpu::CpuInfo& cpu_info() const { return info_; }
static void InitializeForTesting(scoped_refptr<CpuInfoProvider> provider);
private:
friend class MockCpuInfoProviderImpl;
CpuInfoProvider();
~CpuInfoProvider() override;
virtual bool QueryCpuTimePerProcessor(
std::vector<api::system_cpu::ProcessorInfo>* infos);
bool QueryInfo() override;
std::vector<std::string> GetFeatures() const;
api::system_cpu::CpuInfo info_;
static base::LazyInstance<scoped_refptr<CpuInfoProvider>>::DestructorAtExit
provider_;
#if defined(ARCH_CPU_X86_FAMILY)
base::CPU cpu_;
#endif
};
}
#endif