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

Unified Diff: chrome/browser/extensions/api/image_writer_private/operation_manager.cc

Issue 282853003: Unmounts volumes before writing to a drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds compile guard to Chrome OS includes in test_utils.h Created 6 years, 7 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/extensions/api/image_writer_private/operation_manager.cc
diff --git a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
index f87f8ccbf7fe82ab6dc9a5ecd980cf9e588a0257..079125cf37031832a2b378a79c138aa8c223ce20 100644
--- a/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
+++ b/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
@@ -64,9 +64,14 @@ void OperationManager::StartWriteFromUrl(
const std::string& hash,
const std::string& device_path,
const Operation::StartWriteCallback& callback) {
+#if defined(OS_CHROMEOS)
+ // Chrome OS can only support a single operation at a time.
+ if (operations_.size() > 0) {
+#else
OperationMap::iterator existing_operation = operations_.find(extension_id);
if (existing_operation != operations_.end()) {
+#endif
return callback.Run(false, error::kOperationAlreadyInProgress);
}
@@ -89,9 +94,14 @@ void OperationManager::StartWriteFromFile(
const base::FilePath& path,
const std::string& device_path,
const Operation::StartWriteCallback& callback) {
+#if defined(OS_CHROMEOS)
+ // Chrome OS can only support a single operation at a time.
+ if (operations_.size() > 0) {
+#else
OperationMap::iterator existing_operation = operations_.find(extension_id);
if (existing_operation != operations_.end()) {
+#endif
return callback.Run(false, error::kOperationAlreadyInProgress);
}

Powered by Google App Engine
This is Rietveld 408576698