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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_system_provider.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« 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