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

Side by Side Diff: base/sys_info_linux.cc

Issue 1011433002: base: "implement" seek time detection for iOS/Android and add more stubs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ssd
Patch Set: -OS_ANDROID 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_ios.mm ('k') | base/sys_info_mac.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // static 61 // static
62 int64 SysInfo::AmountOfAvailablePhysicalMemory() { 62 int64 SysInfo::AmountOfAvailablePhysicalMemory() {
63 return AmountOfMemory(_SC_AVPHYS_PAGES); 63 return AmountOfMemory(_SC_AVPHYS_PAGES);
64 } 64 }
65 65
66 // static 66 // static
67 int64 SysInfo::AmountOfPhysicalMemory() { 67 int64 SysInfo::AmountOfPhysicalMemory() {
68 return g_lazy_physical_memory.Get().value(); 68 return g_lazy_physical_memory.Get().value();
69 } 69 }
70 70
71 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
72 bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) {
73 // TODO(dbeam): implement.
74 return false;
75 }
76 #endif
77
71 // static 78 // static
72 size_t SysInfo::MaxSharedMemorySize() { 79 size_t SysInfo::MaxSharedMemorySize() {
73 return g_lazy_max_shared_memory.Get().value(); 80 return g_lazy_max_shared_memory.Get().value();
74 } 81 }
75 82
76 // static 83 // static
77 std::string SysInfo::CPUModelName() { 84 std::string SysInfo::CPUModelName() {
78 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) 85 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
79 const char kCpuModelPrefix[] = "Hardware"; 86 const char kCpuModelPrefix[] = "Hardware";
80 #else 87 #else
81 const char kCpuModelPrefix[] = "model name"; 88 const char kCpuModelPrefix[] = "model name";
82 #endif 89 #endif
83 std::string contents; 90 std::string contents;
84 ReadFileToString(FilePath("/proc/cpuinfo"), &contents); 91 ReadFileToString(FilePath("/proc/cpuinfo"), &contents);
85 DCHECK(!contents.empty()); 92 DCHECK(!contents.empty());
86 if (!contents.empty()) { 93 if (!contents.empty()) {
87 std::istringstream iss(contents); 94 std::istringstream iss(contents);
88 std::string line; 95 std::string line;
89 while (std::getline(iss, line)) { 96 while (std::getline(iss, line)) {
90 if (line.compare(0, strlen(kCpuModelPrefix), kCpuModelPrefix) == 0) { 97 if (line.compare(0, strlen(kCpuModelPrefix), kCpuModelPrefix) == 0) {
91 size_t pos = line.find(": "); 98 size_t pos = line.find(": ");
92 return line.substr(pos + 2); 99 return line.substr(pos + 2);
93 } 100 }
94 } 101 }
95 } 102 }
96 return std::string(); 103 return std::string();
97 } 104 }
98 105
99 } // namespace base 106 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_ios.mm ('k') | base/sys_info_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698