| 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 | 20 |
| 21 info->num_of_processors = base::SysInfo::NumberOfProcessors(); | 21 bool CpuInfoProvider::QueryInfo() { |
| 22 info->arch_name = base::SysInfo::OperatingSystemArchitecture(); | 22 info_.num_of_processors = base::SysInfo::NumberOfProcessors(); |
| 23 info->model_name = base::SysInfo::CPUModelName(); | 23 info_.arch_name = base::SysInfo::OperatingSystemArchitecture(); |
| 24 info_.model_name = base::SysInfo::CPUModelName(); |
| 24 return true; | 25 return true; |
| 25 } | 26 } |
| 26 | 27 |
| 27 // static | 28 // static |
| 28 CpuInfoProvider* CpuInfoProvider::Get() { | 29 CpuInfoProvider* CpuInfoProvider::Get() { |
| 29 return CpuInfoProvider::GetInstance<CpuInfoProvider>(); | 30 return CpuInfoProvider::GetInstance<CpuInfoProvider>(); |
| 30 } | 31 } |
| 31 | 32 |
| 32 } // namespace extensions | 33 } // namespace extensions |
| OLD | NEW |