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

Side by Side Diff: extensions/browser/api/system_cpu/cpu_info_provider.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/api/system_cpu/cpu_info_provider.h" 5 #include "extensions/browser/api/system_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 core_api::system_cpu::CpuInfo; 11 using core_api::system_cpu::CpuInfo;
12 12
13 // Static member intialization. 13 // Static member intialization.
14 base::LazyInstance<scoped_refptr<CpuInfoProvider> > CpuInfoProvider::provider_ = 14 base::LazyInstance<scoped_refptr<CpuInfoProvider> > CpuInfoProvider::provider_ =
15 LAZY_INSTANCE_INITIALIZER; 15 LAZY_INSTANCE_INITIALIZER;
16 16
17 CpuInfoProvider::CpuInfoProvider() { 17 CpuInfoProvider::CpuInfoProvider() {
18 } 18 }
19 19
20 CpuInfoProvider::~CpuInfoProvider() { 20 CpuInfoProvider::~CpuInfoProvider() {
21 } 21 }
22 22
23 void CpuInfoProvider::InitializeForTesting( 23 void CpuInfoProvider::InitializeForTesting(
24 scoped_refptr<CpuInfoProvider> provider) { 24 scoped_refptr<CpuInfoProvider> provider) {
25 DCHECK(provider.get() != NULL); 25 DCHECK(provider.get() != nullptr);
26 provider_.Get() = provider; 26 provider_.Get() = provider;
27 } 27 }
28 28
29 bool CpuInfoProvider::QueryInfo() { 29 bool CpuInfoProvider::QueryInfo() {
30 info_.num_of_processors = base::SysInfo::NumberOfProcessors(); 30 info_.num_of_processors = base::SysInfo::NumberOfProcessors();
31 info_.arch_name = base::SysInfo::OperatingSystemArchitecture(); 31 info_.arch_name = base::SysInfo::OperatingSystemArchitecture();
32 info_.model_name = base::SysInfo::CPUModelName(); 32 info_.model_name = base::SysInfo::CPUModelName();
33 info_.features = GetFeatures(); 33 info_.features = GetFeatures();
34 34
35 info_.processors.clear(); 35 info_.processors.clear();
(...skipping 25 matching lines...) Expand all
61 features.push_back("sse4_1"); 61 features.push_back("sse4_1");
62 if (cpu_.has_sse42()) 62 if (cpu_.has_sse42())
63 features.push_back("sse4_2"); 63 features.push_back("sse4_2");
64 if (cpu_.has_avx()) 64 if (cpu_.has_avx())
65 features.push_back("avx"); 65 features.push_back("avx");
66 return features; 66 return features;
67 } 67 }
68 68
69 // static 69 // static
70 CpuInfoProvider* CpuInfoProvider::Get() { 70 CpuInfoProvider* CpuInfoProvider::Get() {
71 if (provider_.Get().get() == NULL) 71 if (provider_.Get().get() == nullptr)
72 provider_.Get() = new CpuInfoProvider(); 72 provider_.Get() = new CpuInfoProvider();
73 return provider_.Get().get(); 73 return provider_.Get().get();
74 } 74 }
75 75
76 } // namespace extensions 76 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698