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

Unified Diff: webkit/fileapi/isolated_mount_point_provider.cc

Issue 11804005: Cleanup file permission check code in FileAPIMessageFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cros+native-local perm fix Created 7 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 | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_mount_point_provider.cc
diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc
index 7e72f4a4f80f1dc18f9eca57c13b2a92cdc6f5fc..1bbb9406e29ed6e35a184e4226778d7625276552 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -100,10 +100,16 @@ FileSystemFileUtil* IsolatedMountPointProvider::GetFileUtil(
return NULL;
}
-FilePath IsolatedMountPointProvider::GetPathForPermissionsCheck(
- const FilePath& virtual_path) const {
- // For isolated filesystems we only check per-filesystem permissions.
- return FilePath();
+FilePermissionPolicy IsolatedMountPointProvider::GetPermissionPolicy(
+ const FileSystemURL& url, int permissions) const {
+ if (url.type() == kFileSystemTypeDragged && url.path().empty()) {
+ // The root directory of the dragged filesystem must be always read-only.
+ if (permissions != kReadFilePermissions)
+ return FILE_PERMISSION_ALWAYS_DENY;
+ }
+ // Access to isolated file systems should be checked using per-filesystem
+ // access permission.
+ return FILE_PERMISSION_USE_FILESYSTEM_PERMISSION;
}
FileSystemOperation* IsolatedMountPointProvider::CreateFileSystemOperation(
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698