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

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

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.h
diff --git a/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h b/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h
index 0645f6828dc872cf07f42e11fade17106e404551..ed9372ef69ebed6a1acbda5e24c3561b79e037ff 100644
--- a/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h
+++ b/chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+#include <queue>
#include "base/compiler_specific.h"
#include "base/macros.h"
@@ -66,9 +67,16 @@ class FakeDiskMountManager : public chromeos::disks::DiskMountManager {
const std::string& mount_label,
chromeos::MountType type,
chromeos::MountAccessMode access_mode) override;
+ // In order to simulate asynchronous invocation of callbacks after unmount
+ // is finished, |callback| will be invoked only when
+ // |FinishAllUnmountRequest()| is called.
void UnmountPath(const std::string& mount_path,
chromeos::UnmountOptions options,
const UnmountPathCallback& callback) override;
+ // Emulates that all mount request finished.
+ // Return true if there was one or more mount request enqueued, or false
+ // otherwise.
+ bool FinishAllUnmountPathRequests();
fukino 2016/09/16 07:31:34 This is not an override of DiskMountManager. We n
yamaguchi 2016/09/26 02:25:28 Done.
void FormatMountedDevice(const std::string& mount_path) override;
void UnmountDeviceRecursively(
const std::string& device_path,
@@ -80,6 +88,7 @@ class FakeDiskMountManager : public chromeos::disks::DiskMountManager {
private:
base::ObserverList<Observer> observers_;
+ std::queue<UnmountPathCallback> pending_unmount_callbacks_;
DiskMap disks_;
MountPointMap mount_points_;

Powered by Google App Engine
This is Rietveld 408576698