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

Unified Diff: chrome/browser/chromeos/file_system_provider/throttled_file_system.cc

Issue 971303003: Simplify file_system_provider::Queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « chrome/browser/chromeos/file_system_provider/queue_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_system_provider/throttled_file_system.cc
diff --git a/chrome/browser/chromeos/file_system_provider/throttled_file_system.cc b/chrome/browser/chromeos/file_system_provider/throttled_file_system.cc
index dc01372c78c98148b5841ab8f1298b4047812fdc..b0d018fff3247f389768598dddec66e1f102aac4 100644
--- a/chrome/browser/chromeos/file_system_provider/throttled_file_system.cc
+++ b/chrome/browser/chromeos/file_system_provider/throttled_file_system.cc
@@ -195,19 +195,12 @@ void ThrottledFileSystem::OnOpenFileCompleted(int queue_token,
const OpenFileCallback& callback,
int file_handle,
base::File::Error result) {
- // The task may be aborted either via the callback, or by the operation, eg.
- // because of destroying the request manager or unmounting the file system
- // during the operation. Mark the task as completed only if it hasn't been
- // aborted before.
- if (!open_queue_->IsAborted(queue_token))
- open_queue_->Complete(queue_token);
-
// If the file is opened successfully then hold the queue token until the file
// is closed.
if (result == base::File::FILE_OK)
opened_files_[file_handle] = queue_token;
else
- open_queue_->Remove(queue_token);
+ open_queue_->Complete(queue_token);
callback.Run(file_handle, result);
}
@@ -220,10 +213,10 @@ void ThrottledFileSystem::OnCloseFileCompleted(
// closed on the C++ side. Release the task from the queue, so other files
// which are enqueued can be opened.
const auto it = opened_files_.find(file_handle);
- CHECK(it != opened_files_.end());
+ DCHECK(it != opened_files_.end());
const int queue_token = it->second;
- open_queue_->Remove(queue_token);
+ open_queue_->Complete(queue_token);
opened_files_.erase(file_handle);
callback.Run(result);
« no previous file with comments | « chrome/browser/chromeos/file_system_provider/queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698