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 <mach/mach.h> | 7 #include <mach/mach.h> |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
8 #include <sys/sysctl.h> | 10 #include <sys/sysctl.h> |
9 #include <sys/types.h> | 11 #include <sys/types.h> |
10 #import <UIKit/UIKit.h> | 12 #import <UIKit/UIKit.h> |
11 | 13 |
12 #include "base/logging.h" | 14 #include "base/logging.h" |
13 #include "base/mac/scoped_mach_port.h" | 15 #include "base/mac/scoped_mach_port.h" |
14 #include "base/mac/scoped_nsautorelease_pool.h" | 16 #include "base/mac/scoped_nsautorelease_pool.h" |
| 17 #include "base/macros.h" |
15 #include "base/strings/sys_string_conversions.h" | 18 #include "base/strings/sys_string_conversions.h" |
16 | 19 |
17 namespace base { | 20 namespace base { |
18 | 21 |
19 // static | 22 // static |
20 std::string SysInfo::OperatingSystemName() { | 23 std::string SysInfo::OperatingSystemName() { |
21 static dispatch_once_t get_system_name_once; | 24 static dispatch_once_t get_system_name_once; |
22 static std::string* system_name; | 25 static std::string* system_name; |
23 dispatch_once(&get_system_name_once, ^{ | 26 dispatch_once(&get_system_name_once, ^{ |
24 base::mac::ScopedNSAutoreleasePool pool; | 27 base::mac::ScopedNSAutoreleasePool pool; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // static | 101 // static |
99 std::string SysInfo::CPUModelName() { | 102 std::string SysInfo::CPUModelName() { |
100 char name[256]; | 103 char name[256]; |
101 size_t len = arraysize(name); | 104 size_t len = arraysize(name); |
102 if (sysctlbyname("machdep.cpu.brand_string", &name, &len, NULL, 0) == 0) | 105 if (sysctlbyname("machdep.cpu.brand_string", &name, &len, NULL, 0) == 0) |
103 return name; | 106 return name; |
104 return std::string(); | 107 return std::string(); |
105 } | 108 } |
106 | 109 |
107 } // namespace base | 110 } // namespace base |
OLD | NEW |