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

Side by Side Diff: base/sys_info_linux.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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
« no previous file with comments | « base/sys_info_android.cc ('k') | base/system_monitor/system_monitor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 25 matching lines...) Expand all
36 contents.erase(contents.length() - 1); 36 contents.erase(contents.length() - 1);
37 } 37 }
38 38
39 uint64 limit; 39 uint64 limit;
40 if (!base::StringToUint64(contents, &limit)) { 40 if (!base::StringToUint64(contents, &limit)) {
41 limit = 0; 41 limit = 0;
42 } 42 }
43 if (limit > std::numeric_limits<size_t>::max()) { 43 if (limit > std::numeric_limits<size_t>::max()) {
44 limit = 0; 44 limit = 0;
45 } 45 }
46 DCHECK(limit > 0); 46 DCHECK_GT(limit, 0u);
47 return static_cast<size_t>(limit); 47 return static_cast<size_t>(limit);
48 } 48 }
49 49
50 base::LazyInstance< 50 base::LazyInstance<
51 base::internal::LazySysInfoValue<int64, AmountOfPhysicalMemory> >::Leaky 51 base::internal::LazySysInfoValue<int64, AmountOfPhysicalMemory> >::Leaky
52 g_lazy_physical_memory = LAZY_INSTANCE_INITIALIZER; 52 g_lazy_physical_memory = LAZY_INSTANCE_INITIALIZER;
53 base::LazyInstance< 53 base::LazyInstance<
54 base::internal::LazySysInfoValue<size_t, MaxSharedMemorySize> >::Leaky 54 base::internal::LazySysInfoValue<size_t, MaxSharedMemorySize> >::Leaky
55 g_lazy_max_shared_memory = LAZY_INSTANCE_INITIALIZER; 55 g_lazy_max_shared_memory = LAZY_INSTANCE_INITIALIZER;
56 56
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if (line.compare(0, strlen(kCpuModelPrefix), kCpuModelPrefix) == 0) { 90 if (line.compare(0, strlen(kCpuModelPrefix), kCpuModelPrefix) == 0) {
91 size_t pos = line.find(": "); 91 size_t pos = line.find(": ");
92 return line.substr(pos + 2); 92 return line.substr(pos + 2);
93 } 93 }
94 } 94 }
95 } 95 }
96 return std::string(); 96 return std::string();
97 } 97 }
98 98
99 } // namespace base 99 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_android.cc ('k') | base/system_monitor/system_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698