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

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

Issue 335753004: [fsp] Cleanup handling errors for operation requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 6 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_system_provider/request_manager.cc
diff --git a/chrome/browser/chromeos/file_system_provider/request_manager.cc b/chrome/browser/chromeos/file_system_provider/request_manager.cc
index 9abe55468b37c2e9886d70f7b448800b81ec4b27..6fb39ddcfe48aff011d7bd5d0df6fe8b1b70c802 100644
--- a/chrome/browser/chromeos/file_system_provider/request_manager.cc
+++ b/chrome/browser/chromeos/file_system_provider/request_manager.cc
@@ -49,7 +49,9 @@ RequestManager::~RequestManager() {
while (it != requests_.end()) {
const int request_id = it->first;
++it;
- RejectRequest(request_id, base::File::FILE_ERROR_ABORT);
+ RejectRequest(request_id,
+ scoped_ptr<RequestValue>(new RequestValue()),
+ base::File::FILE_ERROR_ABORT);
}
DCHECK_EQ(0u, requests_.size());
@@ -111,15 +113,15 @@ bool RequestManager::FulfillRequest(int request_id,
return true;
}
-bool RequestManager::RejectRequest(int request_id, base::File::Error error) {
+bool RequestManager::RejectRequest(int request_id,
+ scoped_ptr<RequestValue> response,
+ base::File::Error error) {
RequestMap::iterator request_it = requests_.find(request_id);
if (request_it == requests_.end())
return false;
- request_it->second->handler->OnError(request_id, error);
-
+ request_it->second->handler->OnError(request_id, response.Pass(), error);
FOR_EACH_OBSERVER(Observer, observers_, OnRequestRejected(request_id, error));
-
DestroyRequest(request_id);
return true;
@@ -150,7 +152,9 @@ RequestManager::Request::~Request() {}
void RequestManager::OnRequestTimeout(int request_id) {
FOR_EACH_OBSERVER(Observer, observers_, OnRequestTimeouted(request_id));
- RejectRequest(request_id, base::File::FILE_ERROR_ABORT);
+ RejectRequest(request_id,
+ scoped_ptr<RequestValue>(new RequestValue()),
+ base::File::FILE_ERROR_ABORT);
}
void RequestManager::DestroyRequest(int request_id) {

Powered by Google App Engine
This is Rietveld 408576698