| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" | 5 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h" |
| 6 | 6 |
| 7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
| 8 | 8 |
| 9 namespace extensions { | 9 namespace extensions { |
| 10 | 10 |
| 11 using api::system_info_cpu::CpuInfo; | 11 using api::system_info_cpu::CpuInfo; |
| 12 | 12 |
| 13 CpuInfoProvider::CpuInfoProvider() {} | 13 CpuInfoProvider::CpuInfoProvider() {} |
| 14 | 14 |
| 15 CpuInfoProvider::~CpuInfoProvider() {} | 15 CpuInfoProvider::~CpuInfoProvider() {} |
| 16 | 16 |
| 17 bool CpuInfoProvider::QueryInfo(CpuInfo* info) { | 17 const CpuInfo* CpuInfoProvider::cpu_info() const { |
| 18 if (info == NULL) | 18 return &info_; |
| 19 return false; | 19 } |
| 20 |
| 21 void CpuInfoProvider::QueryInfo() { |
| 22 CpuInfo* info = &info_; |
| 20 | 23 |
| 21 info->num_of_processors = base::SysInfo::NumberOfProcessors(); | 24 info->num_of_processors = base::SysInfo::NumberOfProcessors(); |
| 22 info->arch_name = base::SysInfo::OperatingSystemArchitecture(); | 25 info->arch_name = base::SysInfo::OperatingSystemArchitecture(); |
| 23 info->model_name = base::SysInfo::CPUModelName(); | 26 info->model_name = base::SysInfo::CPUModelName(); |
| 24 return true; | 27 success_ = true; |
| 25 } | 28 } |
| 26 | 29 |
| 27 // static | 30 // static |
| 28 CpuInfoProvider* CpuInfoProvider::Get() { | 31 CpuInfoProvider* CpuInfoProvider::Get() { |
| 29 return CpuInfoProvider::GetInstance<CpuInfoProvider>(); | 32 return CpuInfoProvider::GetInstance<CpuInfoProvider>(); |
| 30 } | 33 } |
| 31 | 34 |
| 32 } // namespace extensions | 35 } // namespace extensions |
| OLD | NEW |