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

Unified Diff: chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc

Issue 2643013002: Don't crash browser process when OK passed as error code in FSP API. (Closed)
Patch Set: Don't crash browser process when OK passed as error code in FSP API. Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_system_provider.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 80d27f085008aa1a8163d7adf85734e5ace536fd..8db2cbc3de2cd3fd2217eb9cfdf0997db0af47bc 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
@@ -348,6 +348,11 @@ FileSystemProviderInternalOperationRequestedErrorFunction::Run() {
std::unique_ptr<Params> params(Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
+ if (params->error == api::file_system_provider::PROVIDER_ERROR_OK) {
+ // It's incorrect to pass OK as an error code.
+ return ValidationFailure(this);
+ }
+
const base::File::Error error = ProviderErrorToFileError(params->error);
return RejectRequest(RequestValue::CreateForOperationError(std::move(params)),
error);
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_system_provider.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698