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

Side by Side Diff: base/sys_info_posix.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_openbsd.cc ('k') | components/metrics/proto/system_profile.proto » ('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 <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // static 89 // static
90 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { 90 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
91 base::ThreadRestrictions::AssertIOAllowed(); 91 base::ThreadRestrictions::AssertIOAllowed();
92 92
93 struct statvfs stats; 93 struct statvfs stats;
94 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0) 94 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0)
95 return -1; 95 return -1;
96 return static_cast<int64>(stats.f_bavail) * stats.f_frsize; 96 return static_cast<int64>(stats.f_bavail) * stats.f_frsize;
97 } 97 }
98 98
99 bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) {
100 return false;
101 }
102
103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 99 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
104 // static 100 // static
105 std::string SysInfo::OperatingSystemName() { 101 std::string SysInfo::OperatingSystemName() {
106 struct utsname info; 102 struct utsname info;
107 if (uname(&info) < 0) { 103 if (uname(&info) < 0) {
108 NOTREACHED(); 104 NOTREACHED();
109 return std::string(); 105 return std::string();
110 } 106 }
111 return std::string(info.sysname); 107 return std::string(info.sysname);
112 } 108 }
(...skipping 26 matching lines...) Expand all
139 } 135 }
140 return arch; 136 return arch;
141 } 137 }
142 138
143 // static 139 // static
144 size_t SysInfo::VMAllocationGranularity() { 140 size_t SysInfo::VMAllocationGranularity() {
145 return getpagesize(); 141 return getpagesize();
146 } 142 }
147 143
148 } // namespace base 144 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_openbsd.cc ('k') | components/metrics/proto/system_profile.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698