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

Side by Side Diff: base/sys_info.h

Issue 2052663003: Move implementation of QuotaManager.getVolumeInfo to base::SysInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 years, 6 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 | « no previous file | base/sys_info_posix.cc » ('j') | storage/browser/quota/quota_manager.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_SYS_INFO_H_ 5 #ifndef BASE_SYS_INFO_H_
6 #define BASE_SYS_INFO_H_ 6 #define BASE_SYS_INFO_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Return the number of megabytes of available virtual memory, or zero if it 43 // Return the number of megabytes of available virtual memory, or zero if it
44 // is unlimited. 44 // is unlimited.
45 static int AmountOfVirtualMemoryMB() { 45 static int AmountOfVirtualMemoryMB() {
46 return static_cast<int>(AmountOfVirtualMemory() / 1024 / 1024); 46 return static_cast<int>(AmountOfVirtualMemory() / 1024 / 1024);
47 } 47 }
48 48
49 // Return the available disk space in bytes on the volume containing |path|, 49 // Return the available disk space in bytes on the volume containing |path|,
50 // or -1 on failure. 50 // or -1 on failure.
51 static int64_t AmountOfFreeDiskSpace(const FilePath& path); 51 static int64_t AmountOfFreeDiskSpace(const FilePath& path);
52 52
53 // Gets the total disk space and available disk space in bytes on the volume
54 // containing |path|, and returns true on success.
55 static bool GetDiskSpaceInfo(const FilePath& path,
Lei Zhang 2016/06/10 05:46:37 Most of the functions here just retrieves one piec
fukino 2016/06/10 12:10:09 I added the function which returns only total size
56 int64_t* available_bytes,
57 int64_t* total_bytes);
58
53 // Returns system uptime. 59 // Returns system uptime.
54 static TimeDelta Uptime(); 60 static TimeDelta Uptime();
55 61
56 // Returns a descriptive string for the current machine model or an empty 62 // Returns a descriptive string for the current machine model or an empty
57 // string if the machine model is unknown or an error occured. 63 // string if the machine model is unknown or an error occured.
58 // e.g. "MacPro1,1" on Mac, or "Nexus 5" on Android. Only implemented on OS X, 64 // e.g. "MacPro1,1" on Mac, or "Nexus 5" on Android. Only implemented on OS X,
59 // Android, and Chrome OS. This returns an empty string on other platforms. 65 // Android, and Chrome OS. This returns an empty string on other platforms.
60 static std::string HardwareModelName(); 66 static std::string HardwareModelName();
61 67
62 // Returns the name of the host operating system. 68 // Returns the name of the host operating system.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 143
138 // Returns true if this is a low-end device. 144 // Returns true if this is a low-end device.
139 // Low-end device refers to devices having less than 512M memory in the 145 // Low-end device refers to devices having less than 512M memory in the
140 // current implementation. 146 // current implementation.
141 static bool IsLowEndDevice(); 147 static bool IsLowEndDevice();
142 }; 148 };
143 149
144 } // namespace base 150 } // namespace base
145 151
146 #endif // BASE_SYS_INFO_H_ 152 #endif // BASE_SYS_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | base/sys_info_posix.cc » ('j') | storage/browser/quota/quota_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698