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

Issue 1030133002: Move the check for fileBrowserHandler permission to FileBrowserHandler. (Closed)

Created:
5 years, 9 months ago by mtomasz
Modified:
5 years, 9 months ago
Reviewers:
Yoyo Zhou, hirono, sky, tzik
CC:
chromium-reviews, extensions-reviews_chromium.org, tzik, jam, nhiroki, rginda+watch_chromium.org, darin-cc_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, kinuko+fileapi, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move the check for fileBrowserHandler permission to FileBrowserHandler. The previous check location was forcing all apps and extensions which call the chrome.fileSystem.requestFileSystem API, to have "fileBrowserHandler" permission as well. That however doesn't make much sense, as those apps are not always handlers. This CL moves the check to FileBrowserHandler::GetHandler() so simply the permission has to be used only if the app wants to be a handler. TEST=unit_test: FileBrowserHandlerManifestTest.GetHandlersRequiresPermission BUG=470494 Committed: https://crrev.com/c5d0b60cdf33ce7330d6b9ef352b8119e65ec9de Cr-Commit-Position: refs/heads/master@{#322343}

Patch Set 1 #

Patch Set 2 : Cleaned up. #

Patch Set 3 : Fixed manifests, tests + added a test. #

Total comments: 2

Patch Set 4 : Addressed @yoz comment. #

Total comments: 2

Patch Set 5 : Fixed the end-to-end test. #

Patch Set 6 : Fixed test for OS != OS_CHROMEOS. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -222 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/file_manager/file_tasks_unittest.cc View 1 2 5 chunks +76 lines, -64 lines 0 comments Download
M chrome/browser/chromeos/fileapi/file_system_backend.h View 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/fileapi/file_system_backend.cc View 2 chunks +1 line, -16 lines 0 comments Download
M chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc View 8 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/extensions/extension_special_storage_policy.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_special_storage_policy.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/extensions/mock_extension_special_storage_policy.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/mock_extension_special_storage_policy.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/platform_util_unittest.cc View 1 chunk +1 line, -8 lines 0 comments Download
M chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc View 1 2 3 3 chunks +14 lines, -4 lines 0 comments Download
M chrome/common/extensions/api/file_browser_handlers/file_browser_handler_manifest_unittest.cc View 1 2 3 4 5 5 chunks +90 lines, -30 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/app_file_handler_multi/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/content_checksum_test/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/drive_search_test/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/file_watcher_test/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/filesystem_operations_test/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/handler_test_runner/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_browser/multi_profile_copy/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/add_watcher/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/big_file/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/copy_entry/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/create_directory/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/create_file/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/delete_entry/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/evil/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/get_all/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/get_metadata/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/mime_type/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/move_entry/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/notify/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/read_directory/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/read_file/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/remove_watcher/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/thumbnail/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/truncate/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/write_file/manifest.json View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/stubs_app/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_access_permission.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_access_permission_list.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_action_id.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_action_title.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_actions_1.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_actions_2.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_empty_access_permission_list.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_file_filters_1.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_file_filters_2.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/manifest_tests/filebrowser_invalid_file_filters_url.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/manifest_tests/filebrowser_valid.json View 1 2 3 4 5 1 chunk +4 lines, -1 line 0 comments Download
M chrome/test/ext_auto/auto_provider/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M content/public/test/mock_special_storage_policy.h View 2 chunks +0 lines, -5 lines 0 comments Download
M content/public/test/mock_special_storage_policy.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M extensions/shell/browser/shell_special_storage_policy.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M extensions/shell/browser/shell_special_storage_policy.cc View 1 1 chunk +0 lines, -4 lines 0 comments Download
M storage/browser/quota/special_storage_policy.h View 1 chunk +0 lines, -4 lines 0 comments Download
M ui/file_manager/audio_player/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M ui/file_manager/gallery/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M ui/file_manager/image_loader/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M ui/file_manager/video_player/manifest.json View 1 2 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 29 (9 generated)
mtomasz
@yoz, @sky, @tzik: PTAL. Thanks. yoz: chrome/browser/extensions/extension_special_storage_policy.cc [22] chrome/browser/extensions/extension_special_storage_policy.h [22] chrome/browser/extensions/mock_extension_special_storage_policy.cc [22] chrome/browser/extensions/mock_extension_special_storage_policy.h [22] chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc ...
5 years, 9 months ago (2015-03-25 10:03:06 UTC) #1
mtomasz
@yoz, @sky, @tzik: PTAL. Thanks. yoz: chrome/browser/extensions/extension_special_storage_policy.cc [22] chrome/browser/extensions/extension_special_storage_policy.h [22] chrome/browser/extensions/mock_extension_special_storage_policy.cc [22] chrome/browser/extensions/mock_extension_special_storage_policy.h [22] chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc ...
5 years, 9 months ago (2015-03-25 10:03:41 UTC) #3
mtomasz
@hirono: PTAL at *.json. Thanks.
5 years, 9 months ago (2015-03-25 11:05:12 UTC) #5
hirono
lgtm for *.json.
5 years, 9 months ago (2015-03-25 11:31:54 UTC) #6
tzik
lgtm
5 years, 9 months ago (2015-03-25 12:36:33 UTC) #7
sky
LGTM
5 years, 9 months ago (2015-03-25 14:50:59 UTC) #8
Yoyo Zhou
https://codereview.chromium.org/1030133002/diff/40001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc File chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc (right): https://codereview.chromium.org/1030133002/diff/40001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc#newcode120 chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc:120: // Manifest is parsed before permissions are loaded, so ...
5 years, 9 months ago (2015-03-25 20:37:09 UTC) #9
mtomasz
On 2015/03/25 20:37:09, Yoyo Zhou wrote: > https://codereview.chromium.org/1030133002/diff/40001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc > File chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc > (right): > > ...
5 years, 9 months ago (2015-03-25 23:23:45 UTC) #10
mtomasz
https://codereview.chromium.org/1030133002/diff/40001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc File chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc (right): https://codereview.chromium.org/1030133002/diff/40001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc#newcode120 chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc:120: // Manifest is parsed before permissions are loaded, so ...
5 years, 9 months ago (2015-03-26 01:11:46 UTC) #11
Yoyo Zhou
LGTM https://codereview.chromium.org/1030133002/diff/60001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc File chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc (right): https://codereview.chromium.org/1030133002/diff/60001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc#newcode274 chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc:274: // If the permission is missing, then skip ...
5 years, 9 months ago (2015-03-26 01:31:32 UTC) #12
mtomasz
https://codereview.chromium.org/1030133002/diff/60001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc File chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc (right): https://codereview.chromium.org/1030133002/diff/60001/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc#newcode274 chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc:274: // If the permission is missing, then skip parsing ...
5 years, 9 months ago (2015-03-26 01:35:32 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1030133002/80001
5 years, 9 months ago (2015-03-26 03:10:07 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/47570)
5 years, 9 months ago (2015-03-26 03:52:19 UTC) #18
mtomasz
On 2015/03/26 03:52:19, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 9 months ago (2015-03-26 06:55:19 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1030133002/100001
5 years, 9 months ago (2015-03-26 06:58:42 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/47624)
5 years, 9 months ago (2015-03-26 08:08:06 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1030133002/100001
5 years, 9 months ago (2015-03-26 08:09:48 UTC) #26
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 9 months ago (2015-03-26 09:47:13 UTC) #27
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/c5d0b60cdf33ce7330d6b9ef352b8119e65ec9de Cr-Commit-Position: refs/heads/master@{#322343}
5 years, 9 months ago (2015-03-26 09:48:07 UTC) #28
Yoyo Zhou
5 years, 9 months ago (2015-03-26 18:29:09 UTC) #29
Message was sent while issue was closed.
On 2015/03/26 06:55:19, mtomasz wrote:
> On 2015/03/26 03:52:19, I haz the power (commit-bot) wrote:
> > Try jobs failed on following builders:
> >   linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED,
> >
>
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
> 
> @yoz: The entire file browser handling code is executed on OS != Chrome OS,
> which doesn't seem right. I applied quick fixes for now, but I think we should
> not compile this code on non-Chrome-OS operating systems. I'll file a bug for
> it.

Yes, that doesn't seem right. In _permission_features.json we require it to be
ChromeOS, anyhow. IIRC this code used to be under chrome/browser/chromeos, so
that was how it didn't get compiled elsewhere; we should make the gyp/gn rules
do the same now.

Please file such a bug.

Powered by Google App Engine
This is Rietveld 408576698