chore: cherry-pick 96db1e0, fd08636 and bc9cb11 from chromium. #27437
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add restrictions to allowed extensions for File System Access API
These restrictions apply to showOpenFilePicker and showSaveFilePicker.
Existing restriction:
New restrictions:
(cherry picked from commit c75c5a1e1d72fc923c82ebcaeacc874c88215eff)
Bug: 1137247, 1140403, 1140410, 1140417, 1140435, 1152327
Change-Id: I593f7ca60e05177402885bd3026add16b3a07d0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568534
Reviewed-by: Marijn Kruisselbrink mek@chromium.org
Commit-Queue: Austin Sullivan asully@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#833695}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2576109
Commit-Queue: Marijn Kruisselbrink mek@chromium.org
Auto-Submit: Austin Sullivan asully@chromium.org
Cr-Commit-Position: refs/branch-heads/4324@{#649}
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}
Ensure that showSaveFilePicker always shows the extension on Mac.
While not a very strong security boundary, making it possible for
users to know what extension a file will be saved with is a good idea.
This also fixes support for compound extensions with the File System
Access API (i.e. ".tar.gz"). The mac file dialog already had a
workaround if the default path ended in such an extension, but the
same problem occurs if the file type filters include a type with a
compound extension.
(cherry picked from commit 5bf1c6c22201394711a9067d2c970ab9f55555d0)
Bug: 1137247
Change-Id: I492bf36baced3de044b8fed5d57fc7b9b5b64400
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2582842
Reviewed-by: Daniel Cheng dcheng@chromium.org
Reviewed-by: Avi Drissman avi@chromium.org
Commit-Queue: Marijn Kruisselbrink mek@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#835803}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597785
Reviewed-by: Marijn Kruisselbrink mek@chromium.org
Cr-Commit-Position: refs/branch-heads/4324@{#1044}
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}
[FSA] Sanitize descriptions for file types.
This collapses white space, limits the length of descriptions to 64
characters, and on windows strips out '*' characters to ensure the
windows dialog itself will still include the true extension.
This last behavior is triggered by the
keep_extension_visible
flagthat was added in https://crrev.com/c/2582842 to fix a similar problem
on Mac.
(cherry picked from commit 25f38bb6322c0d93722c1faa3f6b4ea2daf2dc90)
Tested: Verified that the extension is shown in the pickers shown by https://fsa-tests.glitch.me/accepts.html
Bug: 1137247
Change-Id: Ife2344589427dbc1055234026601642113b6a791
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586958
Commit-Queue: Marijn Kruisselbrink mek@chromium.org
Reviewed-by: Robert Liao robliao@chromium.org
Reviewed-by: Victor Costan pwnall@chromium.org
Cr-Original-Commit-Position: refs/heads/master@{#837391}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597151
Reviewed-by: Marijn Kruisselbrink mek@chromium.org
Cr-Commit-Position: refs/branch-heads/4324@{#1052}
Cr-Branched-From: c73b5a651d37a6c4d0b8e3262cc4015a5579c6c8-refs/heads/master@{#827102}
Release Notes
Notes: backported the fixes to the save file dialog related CVE-2021-21123, CVE-2021-21129, CVE-2021-21130, CVE-2021-21131, CVE-2021-21141.