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

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

Issue 11140015: Cleanup: Rename to base::SysInfo::CPUArchitecture() to OperatingSystemArchitecture(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « base/sys_info_win.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/common/chrome_notification_types.h" 8 #include "chrome/common/chrome_notification_types.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/notification_details.h" 10 #include "content/public/browser/notification_details.h"
(...skipping 21 matching lines...) Expand all
32 CpuInfoProvider::~CpuInfoProvider() { 32 CpuInfoProvider::~CpuInfoProvider() {
33 DCHECK(sampling_timer_ == NULL); 33 DCHECK(sampling_timer_ == NULL);
34 registrar_.RemoveAll(); 34 registrar_.RemoveAll();
35 } 35 }
36 36
37 bool CpuInfoProvider::QueryInfo(CpuInfo* info) { 37 bool CpuInfoProvider::QueryInfo(CpuInfo* info) {
38 if (info == NULL) 38 if (info == NULL)
39 return false; 39 return false;
40 40
41 info->num_of_processors = base::SysInfo::NumberOfProcessors(); 41 info->num_of_processors = base::SysInfo::NumberOfProcessors();
42 info->arch_name = base::SysInfo::CPUArchitecture(); 42 info->arch_name = base::SysInfo::OperatingSystemArchitecture();
43 info->model_name = base::SysInfo::CPUModelName(); 43 info->model_name = base::SysInfo::CPUModelName();
44 return true; 44 return true;
45 } 45 }
46 46
47 void CpuInfoProvider::StartSampling(const SamplingCallback& callback) { 47 void CpuInfoProvider::StartSampling(const SamplingCallback& callback) {
48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
49 BrowserThread::PostTask( 49 BrowserThread::PostTask(
50 BrowserThread::FILE, 50 BrowserThread::FILE,
51 FROM_HERE, 51 FROM_HERE,
52 base::Bind(&CpuInfoProvider::StartSamplingOnFileThread, 52 base::Bind(&CpuInfoProvider::StartSamplingOnFileThread,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 info->average_usage = total_usage / next_cpu_time.size(); 138 info->average_usage = total_usage / next_cpu_time.size();
139 if (!callback_.is_null()) 139 if (!callback_.is_null())
140 callback_.Run(info.Pass()); 140 callback_.Run(info.Pass());
141 // Use next_cpu_time as baseline_cpu_time_ for the next sampling cycle. 141 // Use next_cpu_time as baseline_cpu_time_ for the next sampling cycle.
142 baseline_cpu_time_.swap(next_cpu_time); 142 baseline_cpu_time_.swap(next_cpu_time);
143 } 143 }
144 144
145 } // namespace extensions 145 } // namespace extensions
OLDNEW
« no previous file with comments | « base/sys_info_win.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698