1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/chromium/src/base/cpu.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef BASE_CPU_H_ 1.9 +#define BASE_CPU_H_ 1.10 + 1.11 +#include <string> 1.12 + 1.13 +namespace base { 1.14 + 1.15 +// Query information about the processor. 1.16 +class CPU { 1.17 + public: 1.18 + // Constructor 1.19 + CPU(); 1.20 + 1.21 + // Accessors for CPU information. 1.22 + const std::string& vendor_name() const { return cpu_vendor_; } 1.23 + int stepping() const { return stepping_; } 1.24 + int model() const { return model_; } 1.25 + int family() const { return family_; } 1.26 + int type() const { return type_; } 1.27 + int extended_model() const { return ext_model_; } 1.28 + int extended_family() const { return ext_family_; } 1.29 + 1.30 + private: 1.31 + // Query the processor for CPUID information. 1.32 + void Initialize(); 1.33 + 1.34 + int type_; // process type 1.35 + int family_; // family of the processor 1.36 + int model_; // model of processor 1.37 + int stepping_; // processor revision number 1.38 + int ext_model_; 1.39 + int ext_family_; 1.40 + std::string cpu_vendor_; 1.41 +}; 1.42 + 1.43 +} // namespace base 1.44 + 1.45 +#endif // BASE_CPU_H_