Add FileSystemHandle.remove method#9
Conversation
annevk
left a comment
There was a problem hiding this comment.
You'll need to make your membership of the googlers GitHub organization public to appease the IPR bot.
Removes the extra check added in https://crrev.com/c/3123735. See recent discussion on the spec here: whatwg/fs#9 (comment) Bug: 1114923, 1399660 Change-Id: I0afd561238ae44dfa055e6fff234e801ee8de616
Spec PR: whatwg/fs#9 Bug: 1114923 Change-Id: Ie52068e0053cf3a1b693e09c5623eb4b42dd6eb9
Removes the extra check added in https://crrev.com/c/3123735. See recent discussion on the spec here: whatwg/fs#9 (comment) Bug: 1114923, 1399660 Change-Id: I0afd561238ae44dfa055e6fff234e801ee8de616 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4090632 Auto-Submit: Austin Sullivan <asully@chromium.org> Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081696}
Removes the extra check added in https://crrev.com/c/3123735. See recent discussion on the spec here: whatwg/fs#9 (comment) Bug: 1114923, 1399660 Change-Id: I0afd561238ae44dfa055e6fff234e801ee8de616 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4090632 Auto-Submit: Austin Sullivan <asully@chromium.org> Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081696}
Removes the extra check added in https://crrev.com/c/3123735. See recent discussion on the spec here: whatwg/fs#9 (comment) Bug: 1114923, 1399660 Change-Id: I0afd561238ae44dfa055e6fff234e801ee8de616 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4090632 Auto-Submit: Austin Sullivan <asully@chromium.org> Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081696}
Spec PR: whatwg/fs#9 Bug: 1114923 Change-Id: Ie52068e0053cf3a1b693e09c5623eb4b42dd6eb9
Spec PR: whatwg/fs#9 Bug: 1114923 Change-Id: Ie52068e0053cf3a1b693e09c5623eb4b42dd6eb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4073126 Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Auto-Submit: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081718}
Spec PR: whatwg/fs#9 Bug: 1114923 Change-Id: Ie52068e0053cf3a1b693e09c5623eb4b42dd6eb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4073126 Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Auto-Submit: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081718}
Spec PR: whatwg/fs#9 Bug: 1114923 Change-Id: Ie52068e0053cf3a1b693e09c5623eb4b42dd6eb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4073126 Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Auto-Submit: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081718}
You're correct, and I've updated this in the latest patchset. It's still not perfect since file locking is still done in parallel on the main thread, but once #95 adds the new framework for file locking we can follow that pattern. I'm happy to do that in a follow-up |
|
Also, #73 (comment) is relevant here, too... we may need to specify what taking locks on a directory looks like (i.e. you can't take the lock if a containing file is locked) |
| |accessResult|'s [=file system access result/error name=] and | ||
| abort these steps. | ||
|
|
||
| 1. If |entry| is `null`, [=queue a storage task=] with |global| to [=/reject=] |
There was a problem hiding this comment.
Nit: https://infra.spec.whatwg.org doesn't use markup for null.
| 1. Attempt to remove |child| from the underlying file system. | ||
| If that throws an exception, [=/reject=] |result| with | ||
| that exception and abort these steps. |
There was a problem hiding this comment.
It seems weird that this would happen on the main thread.
|
|
||
| Issue(11): Better specify what possible exceptions this could throw. | ||
|
|
||
| 1. [=Enqueue the following steps=] to the [=file system queue=]: |
There was a problem hiding this comment.
Do we really need nested file system queue steps?
… a=testonly Automatic update from web-platform-tests FSA: Allow removing the root of an OPFS Removes the extra check added in https://crrev.com/c/3123735. See recent discussion on the spec here: whatwg/fs#9 (comment) Bug: 1114923, 1399660 Change-Id: I0afd561238ae44dfa055e6fff234e801ee8de616 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4090632 Auto-Submit: Austin Sullivan <asully@chromium.org> Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081696} -- wpt-commits: 1a3f3a52208c41caad21964990f0b08a56d0264c wpt-pr: 37440
…m-access to fs, a=testonly Automatic update from web-platform-tests FSA: Migrate remove WPTs from file-system-access to fs Spec PR: whatwg/fs#9 Bug: 1114923 Change-Id: Ie52068e0053cf3a1b693e09c5623eb4b42dd6eb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4073126 Reviewed-by: Daseul Lee <dslee@chromium.org> Commit-Queue: Austin Sullivan <asully@chromium.org> Auto-Submit: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1081718} -- wpt-commits: e6c9f0d92dc297b51ad970143ee1680a50ac328f wpt-pr: 37441
Migrated from WICG/file-system-access#283 (see #2)
Addresses WICG/file-system-access#214
Adds the ability for a file or directory to delete itself. See the proposal: https://github.com/whatwg/fs/blob/main/proposals/Remove.md
Currently, it is not possible to remove a file or directory given its handle. You must obtain the handle of the parent directory and call
FileSystemDirectoryHandle.removeEntry().This would enable the common use case where you obtain a file handle from
showSaveFilePicker(), but then decide you don't want to save after all, and delete the file, or clearing an entire bucket file system.(See WHATWG Working Mode: Changes for more details.)
Preview | Diff