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

Unified Diff: chrome/browser/chromeos/policy/device_status_collector.cc

Issue 2556413002: Remove spam log when querying free/total size. (Closed)
Patch Set: Reverted accidential change. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/device_status_collector.cc
diff --git a/chrome/browser/chromeos/policy/device_status_collector.cc b/chrome/browser/chromeos/policy/device_status_collector.cc
index 7c1fea913cbef8ea53de9150531f5254893dcd80..4fda88dcfa3f6c55d4d4f43e01741c20a0783335 100644
--- a/chrome/browser/chromeos/policy/device_status_collector.cc
+++ b/chrome/browser/chromeos/policy/device_status_collector.cc
@@ -108,11 +108,17 @@ std::vector<em::VolumeInfo> GetVolumeInfo(
std::vector<em::VolumeInfo> result;
for (const std::string& mount_point : mount_points) {
base::FilePath mount_path(mount_point);
+
+ // Non-native file systems do not have a mount point in the local file
+ // system. However, it's worth checking here, as it's easier than checking
+ // earlier which mount point is local, and which one is not.
+ if (mount_point.empty() || !base::PathExists(mount_path))
Wez 2016/12/15 19:27:57 nit: It'd be more readable to check mount_path.emp
+ continue;
+
int64_t free_size = base::SysInfo::AmountOfFreeDiskSpace(mount_path);
int64_t total_size = base::SysInfo::AmountOfTotalDiskSpace(mount_path);
if (free_size < 0 || total_size < 0) {
- LOG_IF(ERROR, !mount_point.empty()) << "Unable to get volume status for "
- << mount_point;
+ LOG(ERROR) << "Unable to get volume status for " << mount_point;
continue;
}
em::VolumeInfo info;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698