Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.cc

Issue 10914060: Refine systemInfo.cpu API defintions and provide systemInfo.cpu.get impl for Windows and Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h"
6
7 #include "base/sys_info.h"
8
9 namespace extensions {
10
11 using api::experimental_system_info_cpu::CpuInfo;
12
13 bool CpuInfoProvider::QueryInfo(CpuInfo* info) {
14 if (info == NULL)
15 return false;
16
17 info->num_of_processors = base::SysInfo::NumberOfProcessors();
18 info->arch_name = base::SysInfo::CPUArchitecture();
19 info->model_name = base::SysInfo::CPUModelName();
20 return true;
21 }
22
23 bool CpuInfoProvider::StartSampling(const QueryCpuTimeCallback& callback) {
24 // TODO(hongbo): Implement sampling functionality for event router.
25 return false;
26 }
27
28 bool CpuInfoProvider::StopSampling() {
29 // TODO(hongbo): Implement sampling functionality for event router.
30 return false;
31 }
32
33 // static
34 CpuInfoProvider* CpuInfoProvider::Get() {
35 return CpuInfoProvider::GetInstance<CpuInfoProvider>();
36 }
37
38 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698