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

Issue 12193007: Deprecate MountPointProvider::IsAccessAllowed in favor of GetPermissionPolicy (Closed)

Created:
7 years, 10 months ago by kinuko
Modified:
7 years, 10 months ago
Reviewers:
ericu, tonibarzic, tbarzic, tzik
CC:
chromium-reviews, stevenjb+watch_chromium.org, kinuko+watch, darin-cc_chromium.org, oshima+watch_chromium.org, tzik+watch_chromium.org
Visibility:
Public.

Description

Deprecate MountPointProvider::IsAccessAllowed in favor of GetPermissionPolicy This deprecates: - FileSystemMountPointProvider::IsAccessAllowed - FileSystemMountPointProvider::IsRestrictedFileName and merge the access checks used to be done by them into a single method: FileSystemMountPointProvider::GetPermissionPolicy(). BUG=174550 TEST=CrosMountPointProviderTest.AccessPermissions, SandboxMountPointProviderTest.AccessPermissions Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183130

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : return USE_FILE_PERMISSION for Drive case too #

Patch Set 4 : test fix #

Total comments: 2

Patch Set 5 : test fix #

Total comments: 16

Patch Set 6 : addressed comments #

Total comments: 1

Patch Set 7 : addressed comments #

Total comments: 4

Patch Set 8 : addressed comments #

Patch Set 9 : rebase #

Patch Set 10 : base::FilePath fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -259 lines) Patch
M webkit/chromeos/fileapi/cros_mount_point_provider.h View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download
M webkit/chromeos/fileapi/cros_mount_point_provider.cc View 1 2 3 4 5 4 chunks +34 lines, -23 lines 0 comments Download
M webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc View 4 chunks +76 lines, -32 lines 0 comments Download
M webkit/chromeos/fileapi/file_access_permissions.h View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M webkit/chromeos/fileapi/file_access_permissions.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M webkit/fileapi/file_system_mount_point_provider.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -7 lines 0 comments Download
M webkit/fileapi/file_system_mount_point_provider_unittest.cc View 1 2 3 4 5 6 2 chunks +0 lines, -102 lines 0 comments Download
M webkit/fileapi/isolated_mount_point_provider.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -2 lines 0 comments Download
M webkit/fileapi/isolated_mount_point_provider.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -12 lines 0 comments Download
M webkit/fileapi/local_file_system_operation.cc View 1 2 chunks +7 lines, -32 lines 0 comments Download
M webkit/fileapi/sandbox_mount_point_provider.h View 1 chunk +0 lines, -2 lines 0 comments Download
M webkit/fileapi/sandbox_mount_point_provider.cc View 1 2 3 4 5 6 7 8 9 2 chunks +25 lines, -30 lines 0 comments Download
M webkit/fileapi/sandbox_mount_point_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +94 lines, -0 lines 0 comments Download
M webkit/fileapi/test_mount_point_provider.h View 1 chunk +0 lines, -2 lines 0 comments Download
M webkit/fileapi/test_mount_point_provider.cc View 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
kinuko
Toni, I'm also thinking about removing access checks from LocalFileSystemOperation::SetUp. Since your change will be ...
7 years, 10 months ago (2013-02-04 05:12:50 UTC) #1
tonibarzic
I'll take a closer look tomorrow.. https://codereview.chromium.org/12193007/diff/17/webkit/chromeos/fileapi/cros_mount_point_provider.cc File webkit/chromeos/fileapi/cros_mount_point_provider.cc (right): https://codereview.chromium.org/12193007/diff/17/webkit/chromeos/fileapi/cros_mount_point_provider.cc#newcode215 webkit/chromeos/fileapi/cros_mount_point_provider.cc:215: DCHECK_EQ(fileapi::kFileSystemTypeDrive, url.type()); I ...
7 years, 10 months ago (2013-02-04 08:01:53 UTC) #2
kinuko
Thanks! https://codereview.chromium.org/12193007/diff/17/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/17/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { Maybe this change needs some more ...
7 years, 10 months ago (2013-02-04 08:58:25 UTC) #3
tbarzic
ChromeOS part lgtm https://codereview.chromium.org/12193007/diff/17/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/17/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { On 2013/02/04 08:58:25, kinuko ...
7 years, 10 months ago (2013-02-05 00:09:34 UTC) #4
tbarzic
https://codereview.chromium.org/12193007/diff/17001/webkit/chromeos/fileapi/cros_mount_point_provider.cc File webkit/chromeos/fileapi/cros_mount_point_provider.cc (right): https://codereview.chromium.org/12193007/diff/17001/webkit/chromeos/fileapi/cros_mount_point_provider.cc#newcode180 webkit/chromeos/fileapi/cros_mount_point_provider.cc:180: permissions != fileapi::kReadFilePermissions) { oh, I missed something: this ...
7 years, 10 months ago (2013-02-05 00:36:35 UTC) #5
kinuko
https://codereview.chromium.org/12193007/diff/17001/webkit/chromeos/fileapi/cros_mount_point_provider.cc File webkit/chromeos/fileapi/cros_mount_point_provider.cc (right): https://codereview.chromium.org/12193007/diff/17001/webkit/chromeos/fileapi/cros_mount_point_provider.cc#newcode180 webkit/chromeos/fileapi/cros_mount_point_provider.cc:180: permissions != fileapi::kReadFilePermissions) { Good catch, fixed.
7 years, 10 months ago (2013-02-05 11:31:20 UTC) #6
kinuko
Eric/Taiju, can you review? We used to do some security check in FileSystemOperation but the ...
7 years, 10 months ago (2013-02-05 12:18:34 UTC) #7
tbarzic
lgtm (again) :) https://codereview.chromium.org/12193007/diff/34001/webkit/chromeos/fileapi/cros_mount_point_provider.cc File webkit/chromeos/fileapi/cros_mount_point_provider.cc (right): https://codereview.chromium.org/12193007/diff/34001/webkit/chromeos/fileapi/cros_mount_point_provider.cc#newcode180 webkit/chromeos/fileapi/cros_mount_point_provider.cc:180: (permissions &~ fileapi::kReadFilePermissions)) { personally, I ...
7 years, 10 months ago (2013-02-05 19:37:28 UTC) #8
ericu
https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { This seems potentially more fragile than asking ...
7 years, 10 months ago (2013-02-05 21:51:57 UTC) #9
tbarzic
https://codereview.chromium.org/12193007/diff/34001/webkit/chromeos/fileapi/cros_mount_point_provider.cc File webkit/chromeos/fileapi/cros_mount_point_provider.cc (right): https://codereview.chromium.org/12193007/diff/34001/webkit/chromeos/fileapi/cros_mount_point_provider.cc#newcode180 webkit/chromeos/fileapi/cros_mount_point_provider.cc:180: (permissions &~ fileapi::kReadFilePermissions)) { On 2013/02/05 21:51:57, ericu wrote: ...
7 years, 10 months ago (2013-02-05 22:21:25 UTC) #10
ericu
https://codereview.chromium.org/12193007/diff/34001/webkit/chromeos/fileapi/cros_mount_point_provider.cc File webkit/chromeos/fileapi/cros_mount_point_provider.cc (right): https://codereview.chromium.org/12193007/diff/34001/webkit/chromeos/fileapi/cros_mount_point_provider.cc#newcode180 webkit/chromeos/fileapi/cros_mount_point_provider.cc:180: (permissions &~ fileapi::kReadFilePermissions)) { On 2013/02/05 22:21:25, tbarzic wrote: ...
7 years, 10 months ago (2013-02-05 22:31:41 UTC) #11
kinuko
https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { On 2013/02/05 21:51:57, ericu wrote: > This ...
7 years, 10 months ago (2013-02-06 03:36:17 UTC) #12
tonibarzic
https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { On 2013/02/06 03:36:17, kinuko wrote: > On ...
7 years, 10 months ago (2013-02-06 06:20:17 UTC) #13
kinuko
https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { On 2013/02/06 06:20:17, tonibarzic wrote: > On ...
7 years, 10 months ago (2013-02-06 09:24:50 UTC) #14
kinuko
Updated the patch, I think it looks better. PTAL thanks, 1. Revived IsAccessAllowed() method for ...
7 years, 10 months ago (2013-02-06 09:31:51 UTC) #15
ericu
https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { On 2013/02/06 09:24:50, kinuko wrote: > On ...
7 years, 10 months ago (2013-02-11 22:29:17 UTC) #16
kinuko
https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc File chrome/browser/chromeos/extensions/file_handler_util.cc (right): https://codereview.chromium.org/12193007/diff/34001/chrome/browser/chromeos/extensions/file_handler_util.cc#newcode664 chrome/browser/chromeos/extensions/file_handler_util.cc:664: fileapi::FILE_PERMISSION_ALWAYS_DENY)) { On 2013/02/11 22:29:17, ericu wrote: > On ...
7 years, 10 months ago (2013-02-12 08:19:51 UTC) #17
ericu
OK, that makes sense. Thanks for the new test, too.
7 years, 10 months ago (2013-02-13 01:33:15 UTC) #18
ericu
LGTM with nits. https://codereview.chromium.org/12193007/diff/20007/webkit/fileapi/file_system_mount_point_provider.h File webkit/fileapi/file_system_mount_point_provider.h (right): https://codereview.chromium.org/12193007/diff/20007/webkit/fileapi/file_system_mount_point_provider.h#newcode129 webkit/fileapi/file_system_mount_point_provider.h:129: virtual bool IsAccessAllowed(const fileapi::FileSystemURL& url) const ...
7 years, 10 months ago (2013-02-13 01:45:55 UTC) #19
kinuko
7 years, 10 months ago (2013-02-13 03:36:30 UTC) #20
Thanks!

https://codereview.chromium.org/12193007/diff/20007/webkit/fileapi/file_syste...
File webkit/fileapi/file_system_mount_point_provider.h (right):

https://codereview.chromium.org/12193007/diff/20007/webkit/fileapi/file_syste...
webkit/fileapi/file_system_mount_point_provider.h:129: virtual bool
IsAccessAllowed(const fileapi::FileSystemURL& url) const = 0;
On 2013/02/13 01:45:56, ericu wrote:
> Given the other methods, please add a comment explaining how this one differs.

> "is allowed" by whom, and if this should override other checks or if it's an
> additional requirement.
> 
> If this will only ever be used by implementers of this interface, we could
also
> make it protected to clarify that.

Done.

https://codereview.chromium.org/12193007/diff/20007/webkit/fileapi/sandbox_mo...
File webkit/fileapi/sandbox_mount_point_provider_unittest.cc (right):

https://codereview.chromium.org/12193007/diff/20007/webkit/fileapi/sandbox_mo...
webkit/fileapi/sandbox_mount_point_provider_unittest.cc:187:
kCreateFilePermissions));
On 2013/02/13 01:45:56, ericu wrote:
> Missing: test for modifying the root directory.

Done.

Powered by Google App Engine
This is Rietveld 408576698