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

Unified Diff: chrome/browser/chromeos/imageburner/burn_controller.cc

Issue 10829160: Created a helper function "FindDiskBySourcePath" in DiskMountManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/imageburner/burn_controller.cc
diff --git a/chrome/browser/chromeos/imageburner/burn_controller.cc b/chrome/browser/chromeos/imageburner/burn_controller.cc
index f83f23a86076be7f63a11b411fd1792124ff800c..33991e36b1df92c9d954d092363e72227f19249e 100644
--- a/chrome/browser/chromeos/imageburner/burn_controller.cc
+++ b/chrome/browser/chromeos/imageburner/burn_controller.cc
@@ -334,8 +334,9 @@ class BurnControllerImpl
int64 GetDeviceSize(const std::string& device_path) {
disks::DiskMountManager* disk_mount_manager =
disks::DiskMountManager::GetInstance();
- const disks::DiskMountManager::DiskMap& disks = disk_mount_manager->disks();
- return disks.find(device_path)->second->total_size_in_bytes();
+ const disks::DiskMountManager::Disk* disk =
+ disk_mount_manager->FindDiskBySourcePath(device_path);
+ return disk ? disk->total_size_in_bytes() : 0;
}
bool CheckNetwork() {

Powered by Google App Engine
This is Rietveld 408576698