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

Side by Side Diff: trunk/src/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc

Issue 342003004: Revert 277929 "[fsp] Cleanup handling errors for operation reque..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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,
87 base::File::Error error) { 86 base::File::Error error) {
88 if (!request_manager_->RejectRequest(request_id_, value.Pass(), error)) 87 if (!request_manager_->RejectRequest(request_id_, error))
89 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); 88 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage);
90 } 89 }
91 90
92 void FileSystemProviderInternalFunction::FulfillRequest( 91 void FileSystemProviderInternalFunction::FulfillRequest(
93 scoped_ptr<RequestValue> value, 92 scoped_ptr<RequestValue> value,
94 bool has_more) { 93 bool has_more) {
95 if (!request_manager_->FulfillRequest(request_id_, value.Pass(), has_more)) 94 if (!request_manager_->FulfillRequest(request_id_, value.Pass(), has_more))
96 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); 95 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage);
97 } 96 }
98 97
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 134
136 void FileSystemProviderInternalFunction::SetErrorResponse( 135 void FileSystemProviderInternalFunction::SetErrorResponse(
137 const std::string& name, 136 const std::string& name,
138 const std::string& message) { 137 const std::string& message) {
139 base::ListValue* result = new base::ListValue(); 138 base::ListValue* result = new base::ListValue();
140 result->Append(CreateError(name, message)); 139 result->Append(CreateError(name, message));
141 SetResult(result); 140 SetResult(result);
142 } 141 }
143 142
144 } // namespace extensions 143 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698