-
Notifications
You must be signed in to change notification settings - Fork 16.8k
feat: implement File System API support #41419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
87057d5 to
eef9839
Compare
|
The general API looks great. TY for taking this on. 🙇 |
MarshallOfSound
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about how to do the details object better
ckerr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some other discussion about the API itself, so I've avoided that for this review and just focused on some more basic C++ code review
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.h
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/electron_file_system_access_permission_context.cc
Show resolved
Hide resolved
a88b1b9 to
2dd2753
Compare
ckerr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More C++ review
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.h
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Show resolved
Hide resolved
|
@codebytere ooooh I see now a lot of this is copied from upstream. Matching the upstream impl is a higher priority than some of my C++ suggestions; feel free to mark as resolved any suggestions that would cause code shear compared to the upstream code!! |
99b4a36 to
5165697
Compare
5165697 to
1c41cb9
Compare
1c41cb9 to
21ec92d
Compare
MarshallOfSound
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs / types seem good. Question about drift from upstream and the block list
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
shell/browser/file_system_access/file_system_access_permission_context.cc
Outdated
Show resolved
Hide resolved
d9e1c1c to
0338431
Compare
81ab428 to
511b705
Compare
31ab84c to
adbbfaa
Compare
jkleinsc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
3fa54d1 to
28db4db
Compare
MarshallOfSound
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
|
Release Notes Persisted
|
|
I have automatically backported this PR to "30-x-y", please check out #41827 |
Chromium implemented the ability to copy files to the clipboard and read file paths from the clipboard in 2021. See: https://chromium-review.googlesource.com/c/chromium/src/+/2651770. In electron#41419, @codebytere has already implemented a partial API (WriteFilesForTesting). In the current PR, I renamed the previous `WriteFilesForTesting` to `WriteFiles` and added a `ReadFiles` method to match it. Additionally, I improved the Write method, and now `clipboard.write` also supports the `files` parameter. Signed-off-by: Kevin Cui <[email protected]>
Chromium implemented the ability to copy files to the clipboard and read file paths from the clipboard in 2021. See: https://chromium-review.googlesource.com/c/chromium/src/+/2651770. In electron#41419, @codebytere has already implemented a partial API (WriteFilesForTesting). In the current PR, I renamed the previous `WriteFilesForTesting` to `WriteFiles` and added a `ReadFiles` method to match it. Additionally, I improved the Write method, and now `clipboard.write` also supports the `files` parameter. fix: electron#9035 electron#26377 Signed-off-by: Kevin Cui <[email protected]>
Chromium implemented the ability to copy files to the clipboard and read file paths from the clipboard in 2021. See: https://chromium-review.googlesource.com/c/chromium/src/+/2651770. In electron#41419, @codebytere has already implemented a partial API (WriteFilesForTesting). In the current PR, I renamed the previous `WriteFilesForTesting` to `WriteFiles` and added a `ReadFiles` method to match it. Additionally, I improved the Write method, and now `clipboard.write` also supports the `files` parameter. fix: electron#9035 electron#26377 Signed-off-by: Kevin Cui <[email protected]>
Chromium implemented the ability to copy files to the clipboard and read file paths from the clipboard in 2021. See: https://chromium-review.googlesource.com/c/chromium/src/+/2651770. In electron#41419, @codebytere has already implemented a partial API (WriteFilesForTesting). In the current PR, I renamed the previous `WriteFilesForTesting` to `WriteFiles` and added a `ReadFiles` method to match it. Additionally, I improved the Write method, and now `clipboard.write` also supports the `files` parameter. fix: electron#9035 electron#26377 Signed-off-by: Kevin Cui <[email protected]>
Chromium implemented the ability to copy files to the clipboard and read file paths from the clipboard in 2021. See: https://chromium-review.googlesource.com/c/chromium/src/+/2651770. In electron#41419, @codebytere has already implemented a partial API (WriteFilesForTesting). In the current PR, I renamed the previous `WriteFilesForTesting` to `WriteFiles` and added a `ReadFiles` method to match it. Additionally, I improved the Write method, and now `clipboard.write` also supports the `files` parameter. fix: electron#9035 electron#26377 Signed-off-by: Kevin Cui <[email protected]>
Description of Change
Closes #28422.
Implements support for the File System API, with permissions brokered through
session.setPermissionRequestHandler. When file or directory functions require permissions,setPermissionRequestHandlerwill be called withdetails.Example:
In the above example, if
callbackis called withtrue, the following would be logged to console:otherwise, the following error would be logged:
Checklist
npm testpassesRelease Notes
Notes: Implemented support for the File System API.