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

Issue 294073007: [fsp] Let extensions decide about the file system id. (Closed)

Created:
6 years, 7 months ago by mtomasz
Modified:
6 years, 7 months ago
Reviewers:
benwells, hirono, kinaba
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, tzik, yoshiki+watch_chromium.org, nhiroki, rginda+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, kinuko+watch, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

[fsp] Let extensions decide about the file system id. Previously, providing extensions were mounting virtual file systems by passing the display name only. As a result, there was no easy way to detect, if the virtual file system is already mounted. This is a big issue for event pages, and extensions providing a remote file system (not archive via file handlers). In such situation, they have to mount the virtual file system as soon as the providing extension is launched. However, the extension may be suspended (event page), and then launched again once a request is emited to it. In such situation, the providing extension would mount the file system again, and cause duplicated entries in Files app. To prevent that, providing extensions need to be able to detect if they already mounted the virtual file system. The current solution let's extensions mount after each startup, but it would fail quietly if a file system with the same id is already mounted. Alternative would be creating a method which would enumerate already registered file systems by the extension, but that would be an overkill. Note, that this strategy is same as for context menus api: https://developer.chrome.com/extensions/contextMenus#method-create TEST=unit_tests: *FileSystemProvider*, browser_tests: *FileSystemProvider* BUG=248427 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272232

Patch Set 1 #

Total comments: 2

Patch Set 2 : Simplified mount paths by using file_system_id instead of index. #

Patch Set 3 : Addressed comments. #

Total comments: 1

Patch Set 4 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+554 lines, -375 lines) Patch
M chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/file_manager/private_api_util.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc View 2 chunks +10 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_system_provider/provider_function.h View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_manager/volume_manager.h View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_manager/volume_manager.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc View 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc View 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/mount_path_util.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/mount_path_util.cc View 1 2 chunks +21 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc View 1 4 chunks +38 lines, -28 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/close_file_unittest.cc View 4 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/get_metadata.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/get_metadata_unittest.cc View 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/open_file_unittest.cc View 4 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/operation.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/read_directory_unittest.cc View 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_info.h View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_info.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc View 1 4 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/service.h View 1 5 chunks +18 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/service.cc View 1 10 chunks +34 lines, -30 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/service_unittest.cc View 1 9 chunks +43 lines, -51 lines 0 comments Download
M chrome/common/extensions/api/file_browser_private.idl View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/file_system_provider.idl View 9 chunks +22 lines, -22 lines 0 comments Download
M chrome/common/extensions/api/file_system_provider_internal.idl View 3 chunks +12 lines, -12 lines 0 comments Download
M chrome/renderer/resources/extensions/file_system_provider_custom_bindings.js View 2 chunks +5 lines, -7 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/get_metadata/test.js View 1 2 3 chunks +44 lines, -17 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/mount/test.js View 2 chunks +65 lines, -42 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/read_directory/test.js View 1 2 8 chunks +47 lines, -19 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js View 1 2 10 chunks +48 lines, -26 lines 0 comments Download
M chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js View 9 chunks +76 lines, -36 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
mtomasz
@kinaba: PTAL at C++. @hirono: PTAL at JS. @benwells: PAT at IDL. This CL is ...
6 years, 7 months ago (2014-05-21 08:59:29 UTC) #1
hirono
https://codereview.chromium.org/294073007/diff/1/chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js File chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js (right): https://codereview.chromium.org/294073007/diff/1/chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js#newcode93 chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js:93: * @param {number} inFileSystemId ID of the file system. ...
6 years, 7 months ago (2014-05-21 10:09:53 UTC) #2
mtomasz
I've simplified the code by removing: > 3. For mount paths, an auto incremented number ...
6 years, 7 months ago (2014-05-22 01:18:36 UTC) #3
mtomasz
https://codereview.chromium.org/294073007/diff/1/chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js File chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js (right): https://codereview.chromium.org/294073007/diff/1/chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js#newcode93 chrome/test/data/extensions/api_test/file_system_provider/read_file/test.js:93: * @param {number} inFileSystemId ID of the file system. ...
6 years, 7 months ago (2014-05-22 02:16:54 UTC) #4
hirono
lgtm with nits. https://codereview.chromium.org/294073007/diff/40001/chrome/common/extensions/api/file_browser_private.idl File chrome/common/extensions/api/file_browser_private.idl (right): https://codereview.chromium.org/294073007/diff/40001/chrome/common/extensions/api/file_browser_private.idl#newcode237 chrome/common/extensions/api/file_browser_private.idl:237: // Id the provided file system ...
6 years, 7 months ago (2014-05-22 03:46:12 UTC) #5
benwells
lgtm
6 years, 7 months ago (2014-05-22 03:58:58 UTC) #6
kinaba
lgtm
6 years, 7 months ago (2014-05-22 05:23:32 UTC) #7
mtomasz
The CQ bit was checked by mtomasz@chromium.org
6 years, 7 months ago (2014-05-22 07:04:22 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/294073007/60001
6 years, 7 months ago (2014-05-22 07:06:31 UTC) #9
mtomasz
The CQ bit was unchecked by mtomasz@chromium.org
6 years, 7 months ago (2014-05-22 12:53:04 UTC) #10
mtomasz
The CQ bit was checked by mtomasz@chromium.org
6 years, 7 months ago (2014-05-22 12:53:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/294073007/60001
6 years, 7 months ago (2014-05-22 12:54:50 UTC) #12
commit-bot: I haz the power
6 years, 7 months ago (2014-05-22 18:06:41 UTC) #13
Message was sent while issue was closed.
Change committed as 272232

Powered by Google App Engine
This is Rietveld 408576698