OLD | NEW |
---|---|
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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 26 matching lines...) Expand all Loading... | |
37 static LazyInstance< | 37 static LazyInstance< |
38 internal::LazySysInfoValue<bool, DetectLowEndDevice> >::Leaky | 38 internal::LazySysInfoValue<bool, DetectLowEndDevice> >::Leaky |
39 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; | 39 g_lazy_low_end_device = LAZY_INSTANCE_INITIALIZER; |
40 | 40 |
41 // static | 41 // static |
42 bool SysInfo::IsLowEndDevice() { | 42 bool SysInfo::IsLowEndDevice() { |
43 return g_lazy_low_end_device.Get().value(); | 43 return g_lazy_low_end_device.Get().value(); |
44 } | 44 } |
45 #endif | 45 #endif |
46 | 46 |
47 #if !defined(OS_MACOSX) | |
Mark Mentovai
2014/11/04 14:36:37
Why even bother implementing this for non-Mac? Not
jeremy
2014/11/05 05:38:06
Leaving this in per-asvitkine's comment.
| |
48 std::string SysInfo::HardwareModelName() { | |
49 NOTIMPLEMENTED() << "HardwareModelName() not supported."; | |
50 return ""; | |
Alexei Svitkine (slow)
2014/11/04 16:22:12
Nit: std::string()
jeremy
2014/11/05 05:38:06
Done.
| |
51 } | |
52 #endif | |
53 | |
47 // static | 54 // static |
48 int64 SysInfo::Uptime() { | 55 int64 SysInfo::Uptime() { |
49 // This code relies on an implementation detail of TimeTicks::Now() - that | 56 // This code relies on an implementation detail of TimeTicks::Now() - that |
50 // its return value happens to coincide with the system uptime value in | 57 // its return value happens to coincide with the system uptime value in |
51 // microseconds, on Win/Mac/iOS/Linux/ChromeOS and Android. | 58 // microseconds, on Win/Mac/iOS/Linux/ChromeOS and Android. |
52 int64 uptime_in_microseconds = TimeTicks::Now().ToInternalValue(); | 59 int64 uptime_in_microseconds = TimeTicks::Now().ToInternalValue(); |
53 return uptime_in_microseconds / 1000; | 60 return uptime_in_microseconds / 1000; |
54 } | 61 } |
55 | 62 |
56 } // namespace base | 63 } // namespace base |
OLD | NEW |