OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 | 14 |
15 int64 SysInfo::AmountOfPhysicalMemory() { | 15 int64 SysInfo::AmountOfPhysicalMemory() { |
16 long pages = sysconf(_SC_PHYS_PAGES); | 16 long pages = sysconf(_SC_PHYS_PAGES); |
17 long page_size = sysconf(_SC_PAGE_SIZE); | 17 long page_size = sysconf(_SC_PAGE_SIZE); |
18 if (pages == -1 || page_size == -1) { | 18 if (pages == -1 || page_size == -1) { |
19 NOTREACHED(); | 19 NOTREACHED(); |
20 return 0; | 20 return 0; |
21 } | 21 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (line.compare(0, strlen(kModelNamePrefix), kModelNamePrefix) == 0) { | 70 if (line.compare(0, strlen(kModelNamePrefix), kModelNamePrefix) == 0) { |
71 size_t pos = line.find(": "); | 71 size_t pos = line.find(": "); |
72 return line.substr(pos + 2); | 72 return line.substr(pos + 2); |
73 } | 73 } |
74 } | 74 } |
75 } | 75 } |
76 return std::string(); | 76 return std::string(); |
77 } | 77 } |
78 | 78 |
79 } // namespace base | 79 } // namespace base |
OLD | NEW |