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

Side by Side Diff: base/sys_info.cc

Issue 1182453004: Write new Starts/EndsWith and convert FilePath functions to StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: default back Created 5 years, 6 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 (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 "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 23 matching lines...) Expand all
34 internal::LazySysInfoValue<bool, DetectLowEndDevice> >::Leaky 34 internal::LazySysInfoValue<bool, DetectLowEndDevice> >::Leaky
35 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; 35 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER;
36 36
37 // static 37 // static
38 bool SysInfo::IsLowEndDevice() { 38 bool SysInfo::IsLowEndDevice() {
39 const std::string group_name = 39 const std::string group_name =
40 base::FieldTrialList::FindFullName("MemoryReduction"); 40 base::FieldTrialList::FindFullName("MemoryReduction");
41 41
42 // Low End Device Mode will be enabled if this client is assigned to 42 // Low End Device Mode will be enabled if this client is assigned to
43 // one of those EnabledXXX groups. 43 // one of those EnabledXXX groups.
44 if (StartsWithASCII(group_name, "Enabled", true)) 44 if (StartsWith(group_name, "Enabled", CompareCase::SENSITIVE))
45 return true; 45 return true;
46 46
47 return g_lazy_low_end_device.Get().value(); 47 return g_lazy_low_end_device.Get().value();
48 } 48 }
49 #endif 49 #endif
50 50
51 #if !defined(OS_MACOSX) || defined(OS_IOS) 51 #if !defined(OS_MACOSX) || defined(OS_IOS)
52 std::string SysInfo::HardwareModelName() { 52 std::string SysInfo::HardwareModelName() {
53 return std::string(); 53 return std::string();
54 } 54 }
55 #endif 55 #endif
56 56
57 // static 57 // static
58 int64 SysInfo::Uptime() { 58 int64 SysInfo::Uptime() {
59 // This code relies on an implementation detail of TimeTicks::Now() - that 59 // This code relies on an implementation detail of TimeTicks::Now() - that
60 // its return value happens to coincide with the system uptime value in 60 // its return value happens to coincide with the system uptime value in
61 // microseconds, on Win/Mac/iOS/Linux/ChromeOS and Android. 61 // microseconds, on Win/Mac/iOS/Linux/ChromeOS and Android.
62 int64 uptime_in_microseconds = TimeTicks::Now().ToInternalValue(); 62 int64 uptime_in_microseconds = TimeTicks::Now().ToInternalValue();
63 return uptime_in_microseconds / 1000; 63 return uptime_in_microseconds / 1000;
64 } 64 }
65 65
66 } // namespace base 66 } // namespace base
OLDNEW
« base/strings/string_util.h ('K') | « base/strings/string_util.cc ('k') | base/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698