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

Unified Diff: chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc

Issue 146283002: Apps: Grant sufficient permissions to the filesystem opened by fileSystem API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
index 78eb12a32d9339355b8c1c62e21c2816eeeb5cd9..9d0a5cd149e08ae5b93c88163abdec4ebb84fbc3 100644
--- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
+++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc
@@ -333,10 +333,12 @@ GrantedFileEntry CreateFileEntry(
content::ChildProcessSecurityPolicy::GetInstance();
policy->GrantReadFileSystem(renderer_id, result.filesystem_id);
if (HasFileSystemWritePermission(extension)) {
- policy->GrantWriteFileSystem(renderer_id, result.filesystem_id);
- policy->GrantDeleteFromFileSystem(renderer_id, result.filesystem_id);
- if (is_directory)
- policy->GrantCreateFileForFileSystem(renderer_id, result.filesystem_id);
+ if (is_directory) {
+ policy->GrantCreateReadWriteFileSystem(renderer_id, result.filesystem_id);
+ } else {
+ policy->GrantWriteFileSystem(renderer_id, result.filesystem_id);
+ policy->GrantDeleteFromFileSystem(renderer_id, result.filesystem_id);
+ }
}
result.id = result.filesystem_id + ":" + result.registered_name;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698