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

Side by Side Diff: chrome/browser/chromeos/extensions/file_system_provider/provider_function.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/extensions/file_system_provider/file_system_pr ovider_api.h" 5 #include "chrome/browser/chromeos/extensions/file_system_provider/file_system_pr ovider_api.h"
6 6
7 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" 7 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
8 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" 8 #include "chrome/browser/chromeos/file_system_provider/request_manager.h"
9 #include "chrome/browser/chromeos/file_system_provider/request_value.h" 9 #include "chrome/browser/chromeos/file_system_provider/request_value.h"
10 #include "chrome/browser/chromeos/file_system_provider/service.h" 10 #include "chrome/browser/chromeos/file_system_provider/service.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 NOTREACHED(); 76 NOTREACHED();
77 } 77 }
78 return base::File::FILE_ERROR_FAILED; 78 return base::File::FILE_ERROR_FAILED;
79 } 79 }
80 80
81 FileSystemProviderInternalFunction::FileSystemProviderInternalFunction() 81 FileSystemProviderInternalFunction::FileSystemProviderInternalFunction()
82 : request_id_(0), request_manager_(NULL) { 82 : request_id_(0), request_manager_(NULL) {
83 } 83 }
84 84
85 void FileSystemProviderInternalFunction::RejectRequest( 85 void FileSystemProviderInternalFunction::RejectRequest(
86 scoped_ptr<chromeos::file_system_provider::RequestValue> value,
86 base::File::Error error) { 87 base::File::Error error) {
87 if (!request_manager_->RejectRequest(request_id_, error)) 88 if (!request_manager_->RejectRequest(request_id_, value.Pass(), error))
88 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); 89 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage);
89 } 90 }
90 91
91 void FileSystemProviderInternalFunction::FulfillRequest( 92 void FileSystemProviderInternalFunction::FulfillRequest(
92 scoped_ptr<RequestValue> value, 93 scoped_ptr<RequestValue> value,
93 bool has_more) { 94 bool has_more) {
94 if (!request_manager_->FulfillRequest(request_id_, value.Pass(), has_more)) 95 if (!request_manager_->FulfillRequest(request_id_, value.Pass(), has_more))
95 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); 96 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage);
96 } 97 }
97 98
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 135
135 void FileSystemProviderInternalFunction::SetErrorResponse( 136 void FileSystemProviderInternalFunction::SetErrorResponse(
136 const std::string& name, 137 const std::string& name,
137 const std::string& message) { 138 const std::string& message) {
138 base::ListValue* result = new base::ListValue(); 139 base::ListValue* result = new base::ListValue();
139 result->Append(CreateError(name, message)); 140 result->Append(CreateError(name, message));
140 SetResult(result); 141 SetResult(result);
141 } 142 }
142 143
143 } // namespace extensions 144 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698