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 <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
9 #include <mach/mach_host.h> | 9 #include <mach/mach_host.h> |
10 #include <mach/mach_init.h> | 10 #include <mach/mach_init.h> |
| 11 #include <stddef.h> |
| 12 #include <stdint.h> |
11 #include <sys/sysctl.h> | 13 #include <sys/sysctl.h> |
12 #include <sys/types.h> | 14 #include <sys/types.h> |
13 | 15 |
14 #include "base/logging.h" | 16 #include "base/logging.h" |
15 #include "base/mac/scoped_mach_port.h" | 17 #include "base/mac/scoped_mach_port.h" |
| 18 #include "base/macros.h" |
16 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
17 | 20 |
18 namespace base { | 21 namespace base { |
19 | 22 |
20 // static | 23 // static |
21 std::string SysInfo::OperatingSystemName() { | 24 std::string SysInfo::OperatingSystemName() { |
22 return "Mac OS X"; | 25 return "Mac OS X"; |
23 } | 26 } |
24 | 27 |
25 // static | 28 // static |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 90 |
88 std::string SysInfo::HardwareModelName() { | 91 std::string SysInfo::HardwareModelName() { |
89 char model[256]; | 92 char model[256]; |
90 size_t len = sizeof(model); | 93 size_t len = sizeof(model); |
91 if (sysctlbyname("hw.model", model, &len, NULL, 0) == 0) | 94 if (sysctlbyname("hw.model", model, &len, NULL, 0) == 0) |
92 return std::string(model, 0, len); | 95 return std::string(model, 0, len); |
93 return std::string(); | 96 return std::string(); |
94 } | 97 } |
95 | 98 |
96 } // namespace base | 99 } // namespace base |
OLD | NEW |