michael@0: // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_CPU_H_ michael@0: #define BASE_CPU_H_ michael@0: michael@0: #include michael@0: michael@0: namespace base { michael@0: michael@0: // Query information about the processor. michael@0: class CPU { michael@0: public: michael@0: // Constructor michael@0: CPU(); michael@0: michael@0: // Accessors for CPU information. michael@0: const std::string& vendor_name() const { return cpu_vendor_; } michael@0: int stepping() const { return stepping_; } michael@0: int model() const { return model_; } michael@0: int family() const { return family_; } michael@0: int type() const { return type_; } michael@0: int extended_model() const { return ext_model_; } michael@0: int extended_family() const { return ext_family_; } michael@0: michael@0: private: michael@0: // Query the processor for CPUID information. michael@0: void Initialize(); michael@0: michael@0: int type_; // process type michael@0: int family_; // family of the processor michael@0: int model_; // model of processor michael@0: int stepping_; // processor revision number michael@0: int ext_model_; michael@0: int ext_family_; michael@0: std::string cpu_vendor_; michael@0: }; michael@0: michael@0: } // namespace base michael@0: michael@0: #endif // BASE_CPU_H_