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

Unified Diff: chrome/browser/chromeos/file_manager/fake_disk_mount_manager.cc

Issue 2348813002: Fix a bug that unmounting devices on the policy update can be a busy loop. (Closed)
Patch Set: Eliminate unrelated and unnecessary change. Created 4 years, 3 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/file_manager/fake_disk_mount_manager.cc
diff --git a/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.cc b/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.cc
index a740093551022ee1fc9fc72d4d0f6c29d7d0f54c..5fb85e4c3f130b2705f0b11e040f7e587997060d 100644
--- a/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.cc
+++ b/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.cc
@@ -107,7 +107,19 @@ void FakeDiskMountManager::UnmountPath(const std::string& mount_path,
OnMountEvent(DiskMountManager::UNMOUNTING,
chromeos::MOUNT_ERROR_NONE,
mount_point));
- // Currently |callback| is just ignored.
+ // Enqueue callback so that |FakeDiskMountManager::FinishAllUnmountRequest()|
+ // can call them.
+ pending_unmount_callbacks_.push(callback);
fukino 2016/09/16 07:31:34 Why do we need FinishAllUnmountPathRequests() call
yamaguchi 2016/09/16 08:49:51 The main purpose of this change in the test & the
+}
+
+bool FakeDiskMountManager::FinishAllUnmountPathRequests() {
+ if (pending_unmount_callbacks_.empty())
+ return false;
+ while (!pending_unmount_callbacks_.empty()) {
+ pending_unmount_callbacks_.front().Run(chromeos::MOUNT_ERROR_NONE);
+ pending_unmount_callbacks_.pop();
+ }
+ return true;
}
void FakeDiskMountManager::FormatMountedDevice(const std::string& mount_path) {

Powered by Google App Engine
This is Rietveld 408576698