| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 RequestValue::CreateForOperationSuccess(std::move(params))), | 341 RequestValue::CreateForOperationSuccess(std::move(params))), |
| 342 false /* has_more */); | 342 false /* has_more */); |
| 343 } | 343 } |
| 344 | 344 |
| 345 ExtensionFunction::ResponseAction | 345 ExtensionFunction::ResponseAction |
| 346 FileSystemProviderInternalOperationRequestedErrorFunction::Run() { | 346 FileSystemProviderInternalOperationRequestedErrorFunction::Run() { |
| 347 using api::file_system_provider_internal::OperationRequestedError::Params; | 347 using api::file_system_provider_internal::OperationRequestedError::Params; |
| 348 std::unique_ptr<Params> params(Params::Create(*args_)); | 348 std::unique_ptr<Params> params(Params::Create(*args_)); |
| 349 EXTENSION_FUNCTION_VALIDATE(params); | 349 EXTENSION_FUNCTION_VALIDATE(params); |
| 350 | 350 |
| 351 if (params->error == api::file_system_provider::PROVIDER_ERROR_OK) { |
| 352 // It's incorrect to pass OK as an error code. |
| 353 return ValidationFailure(this); |
| 354 } |
| 355 |
| 351 const base::File::Error error = ProviderErrorToFileError(params->error); | 356 const base::File::Error error = ProviderErrorToFileError(params->error); |
| 352 return RejectRequest(RequestValue::CreateForOperationError(std::move(params)), | 357 return RejectRequest(RequestValue::CreateForOperationError(std::move(params)), |
| 353 error); | 358 error); |
| 354 } | 359 } |
| 355 | 360 |
| 356 } // namespace extensions | 361 } // namespace extensions |
| OLD | NEW |