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

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

Issue 824753003: [fsp] Wire limiting number of opened files to FSP API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 5 years, 11 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/browser/chromeos/file_system_provider/throttled_file_system_unittest.cc » ('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 c315d406a1675865e75d86c95bf7935375aeb610..9c9399ce594894518d6bcec7c271d5d2034d9c19 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
@@ -87,6 +87,13 @@ bool FileSystemProviderMountFunction::RunSync() {
return false;
}
+ // If the opened files limit is set, then it must be larger or equal than 0.
+ if (params->options.opened_files_limit.get() &&
+ *params->options.opened_files_limit.get() < 0) {
+ SetError(FileErrorToString(base::File::FILE_ERROR_INVALID_OPERATION));
+ return false;
+ }
+
Service* const service = Service::Get(GetProfile());
DCHECK(service);
@@ -94,6 +101,9 @@ bool FileSystemProviderMountFunction::RunSync() {
options.file_system_id = params->options.file_system_id;
options.display_name = params->options.display_name;
options.writable = params->options.writable;
+ options.opened_files_limit = params->options.opened_files_limit.get()
+ ? *params->options.opened_files_limit.get()
+ : 0;
options.supports_notify_tag = params->options.supports_notify_tag;
const base::File::Error result =
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/throttled_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698