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

Unified Diff: extensions/browser/api/system_cpu/cpu_info_provider.cc

Issue 389633002: Move system.* family of APIs to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/system_cpu/cpu_info_provider.cc
diff --git a/chrome/browser/extensions/api/system_cpu/cpu_info_provider.cc b/extensions/browser/api/system_cpu/cpu_info_provider.cc
similarity index 60%
rename from chrome/browser/extensions/api/system_cpu/cpu_info_provider.cc
rename to extensions/browser/api/system_cpu/cpu_info_provider.cc
index 1a10dd60ca4f525056c4f9421c9a8748945008c9..e2c3f611e4e12738a117807c8a3491c8ef07cd8a 100644
--- a/chrome/browser/extensions/api/system_cpu/cpu_info_provider.cc
+++ b/extensions/browser/api/system_cpu/cpu_info_provider.cc
@@ -2,24 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/api/system_cpu/cpu_info_provider.h"
+#include "extensions/browser/api/system_cpu/cpu_info_provider.h"
#include "base/sys_info.h"
namespace extensions {
-using api::system_cpu::CpuInfo;
+using core_api::system_cpu::CpuInfo;
// Static member intialization.
-base::LazyInstance<scoped_refptr<CpuInfoProvider> >
- CpuInfoProvider::provider_ = LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<scoped_refptr<CpuInfoProvider> > CpuInfoProvider::provider_ =
+ LAZY_INSTANCE_INITIALIZER;
-CpuInfoProvider::CpuInfoProvider() {}
-
-CpuInfoProvider::~CpuInfoProvider() {}
+CpuInfoProvider::CpuInfoProvider() {
+}
-const CpuInfo& CpuInfoProvider::cpu_info() const {
- return info_;
+CpuInfoProvider::~CpuInfoProvider() {
}
void CpuInfoProvider::InitializeForTesting(
@@ -37,8 +35,8 @@ bool CpuInfoProvider::QueryInfo() {
info_.processors.clear();
// Fill in the correct number of uninitialized ProcessorInfos.
for (int i = 0; i < info_.num_of_processors; ++i) {
- info_.processors.push_back(linked_ptr<api::system_cpu::ProcessorInfo>(
- new api::system_cpu::ProcessorInfo()));
+ info_.processors.push_back(linked_ptr<core_api::system_cpu::ProcessorInfo>(
+ new core_api::system_cpu::ProcessorInfo()));
}
// Initialize the ProcessorInfos, or return an empty array if that fails.
if (!QueryCpuTimePerProcessor(&info_.processors))
@@ -49,14 +47,22 @@ bool CpuInfoProvider::QueryInfo() {
std::vector<std::string> CpuInfoProvider::GetFeatures() const {
std::vector<std::string> features;
// These are the feature codes used by /proc/cpuinfo on Linux.
- if (cpu_.has_mmx()) features.push_back("mmx");
- if (cpu_.has_sse()) features.push_back("sse");
- if (cpu_.has_sse2()) features.push_back("sse2");
- if (cpu_.has_sse3()) features.push_back("sse3");
- if (cpu_.has_ssse3()) features.push_back("ssse3");
- if (cpu_.has_sse41()) features.push_back("sse4_1");
- if (cpu_.has_sse42()) features.push_back("sse4_2");
- if (cpu_.has_avx()) features.push_back("avx");
+ if (cpu_.has_mmx())
+ features.push_back("mmx");
+ if (cpu_.has_sse())
+ features.push_back("sse");
+ if (cpu_.has_sse2())
+ features.push_back("sse2");
+ if (cpu_.has_sse3())
+ features.push_back("sse3");
+ if (cpu_.has_ssse3())
+ features.push_back("ssse3");
+ if (cpu_.has_sse41())
+ features.push_back("sse4_1");
+ if (cpu_.has_sse42())
+ features.push_back("sse4_2");
+ if (cpu_.has_avx())
+ features.push_back("avx");
return features;
}
« no previous file with comments | « extensions/browser/api/system_cpu/cpu_info_provider.h ('k') | extensions/browser/api/system_cpu/cpu_info_provider_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698