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

Unified Diff: chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.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/extensions/file_system_provider/file_system_provider_api.cc
diff --git a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc
index 5bd2b0a8ea3473ffba0c01f8013334b05400eb82..d15392efb0cfd18215c5a200dbdd4b51b5dc9002 100644
--- a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc
+++ b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc
@@ -97,15 +97,6 @@ bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunWhenValid() {
return true;
}
-bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunWhenValid() {
- using api::file_system_provider_internal::UnmountRequestedError::Params;
- const scoped_ptr<Params> params(Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params);
-
- RejectRequest(ProviderErrorToFileError(params->error));
- return true;
-}
-
bool
FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunWhenValid() {
using api::file_system_provider_internal::GetMetadataRequestedSuccess::Params;
@@ -117,16 +108,6 @@ FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunWhenValid() {
return true;
}
-bool
-FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunWhenValid() {
- using api::file_system_provider_internal::GetMetadataRequestedError::Params;
- const scoped_ptr<Params> params(Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params);
-
- RejectRequest(ProviderErrorToFileError(params->error));
- return true;
-}
-
bool FileSystemProviderInternalReadDirectoryRequestedSuccessFunction::
RunWhenValid() {
using api::file_system_provider_internal::ReadDirectoryRequestedSuccess::
@@ -141,16 +122,6 @@ bool FileSystemProviderInternalReadDirectoryRequestedSuccessFunction::
}
bool
-FileSystemProviderInternalReadDirectoryRequestedErrorFunction::RunWhenValid() {
- using api::file_system_provider_internal::ReadDirectoryRequestedError::Params;
- const scoped_ptr<Params> params(Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params);
-
- RejectRequest(ProviderErrorToFileError(params->error));
- return true;
-}
-
-bool
FileSystemProviderInternalOpenFileRequestedSuccessFunction::RunWhenValid() {
using api::file_system_provider_internal::OpenFileRequestedSuccess::Params;
scoped_ptr<Params> params(Params::Create(*args_));
@@ -161,15 +132,6 @@ FileSystemProviderInternalOpenFileRequestedSuccessFunction::RunWhenValid() {
return true;
}
-bool FileSystemProviderInternalOpenFileRequestedErrorFunction::RunWhenValid() {
- using api::file_system_provider_internal::OpenFileRequestedError::Params;
- const scoped_ptr<Params> params(Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params);
-
- RejectRequest(ProviderErrorToFileError(params->error));
- return true;
-}
-
bool
FileSystemProviderInternalCloseFileRequestedSuccessFunction::RunWhenValid() {
using api::file_system_provider_internal::CloseFileRequestedSuccess::Params;
@@ -181,15 +143,6 @@ FileSystemProviderInternalCloseFileRequestedSuccessFunction::RunWhenValid() {
return true;
}
-bool FileSystemProviderInternalCloseFileRequestedErrorFunction::RunWhenValid() {
- using api::file_system_provider_internal::CloseFileRequestedError::Params;
- const scoped_ptr<Params> params(Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params);
-
- RejectRequest(ProviderErrorToFileError(params->error));
- return true;
-}
-
bool
FileSystemProviderInternalReadFileRequestedSuccessFunction::RunWhenValid() {
using api::file_system_provider_internal::ReadFileRequestedSuccess::Params;
@@ -202,12 +155,12 @@ FileSystemProviderInternalReadFileRequestedSuccessFunction::RunWhenValid() {
return true;
}
-bool FileSystemProviderInternalReadFileRequestedErrorFunction::RunWhenValid() {
- using api::file_system_provider_internal::ReadFileRequestedError::Params;
- const scoped_ptr<Params> params(Params::Create(*args_));
+bool FileSystemProviderInternalOperationRequestedErrorFunction::RunWhenValid() {
+ using api::file_system_provider_internal::OperationRequestedError::Params;
+ scoped_ptr<Params> params(Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
-
- RejectRequest(ProviderErrorToFileError(params->error));
+ RejectRequest(RequestValue::CreateForOperationError(params.Pass()),
+ ProviderErrorToFileError(params->error));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698