Skip to content
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

Cursor support for FileSystemSyncAccessHandle #76

Merged
merged 26 commits into from
Dec 3, 2022

Conversation

jesup
Copy link
Contributor

@jesup jesup commented Nov 30, 2022

Adds cursor to FileSystemSyncAccessHandle, similar to the cursor for WritableFileStream. This means that supplying an 'at:' parameter for every read and write will not be needed.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

@jesup jesup changed the title Cursor for syncaccesshandle Cursor support for FileSystemSyncAccessHandle Nov 30, 2022
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
jesup and others added 3 commits November 30, 2022 07:58
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
jesup and others added 5 commits November 30, 2022 15:50
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
@jesup
Copy link
Contributor Author

jesup commented Nov 30, 2022

Thanks for the careful review, @annevk !

index.bs Outdated Show resolved Hide resolved
index.bs Outdated
@@ -1048,6 +1048,8 @@ as well as obtaining and changing the size of, a single file.
A {{FileSystemSyncAccessHandle}} offers synchronous methods. This allows for higher performance on
contexts where asynchronous operations come with high overhead, e.g., WebAssembly.

A {{FileSystemWritableFileStream}} has a <dfn for="FileSystemWritableFileStream">file position cursor</dfn> initialized at byte offset 0 from the top of the file.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both a FileSystemSyncAccessHandle and FileSystemWritableFileStream should have a cursor, right? And does this need to be explicitly initialized to 0 in the "create a new FileSystemSyncAccessHandle" algorithm below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's usually fine to state the default value of an internal field upfront like is done here.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@jesup
Copy link
Contributor Author

jesup commented Dec 1, 2022

Note that the existing cursor for WritableFileStream should have normative text for [=FileSystemWritableFileStream/file position cursor=]; right now all references are in non-normative text. I'm considering this a separate issue

Copy link
Collaborator

@a-sully a-sully left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from one question, but I'd wait for the +1 from Anne before merging. Thanks for putting this together!

index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
jesup and others added 4 commits December 2, 2022 22:34
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@annevk annevk merged commit 730e2ad into whatwg:main Dec 3, 2022
@a-sully
Copy link
Collaborator

a-sully commented Jan 4, 2023

Question: with this change, should FileSystemReadWriteOptions.at become optional rather than defaulting to 0? Otherwise the behavior for read and write calls using default options is different than if you call the version of the method that does not specify any options

@annevk
Copy link
Member

annevk commented Jan 4, 2023

Filed #81.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 17, 2023
Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 18, 2023
Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137091
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093907}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 18, 2023
Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137091
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093907}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 18, 2023
Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137091
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093907}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 1, 2023
…ndles, a=testonly

Automatic update from web-platform-tests
FSA: Implement a cursor for SyncAccessHandles

Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137091
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093907}

--

wpt-commits: ad88d36028e1564673f3d34b99862c1155da81ab
wpt-pr: 37764
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Feb 3, 2023
…ndles, a=testonly

Automatic update from web-platform-tests
FSA: Implement a cursor for SyncAccessHandles

Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137091
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093907}

--

wpt-commits: ad88d36028e1564673f3d34b99862c1155da81ab
wpt-pr: 37764
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jun 1, 2024
…ndles, a=testonly

Automatic update from web-platform-tests
FSA: Implement a cursor for SyncAccessHandles

Specified at whatwg/fs#76

This only makes sense if the "at" option is optional, so that was later
specified here: whatwg/fs#82

Fixed: 1394790
Change-Id: I51e7343d221c1b89dfb10e22434d9d213e152b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137091
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Daseul Lee <dslee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1093907}

--

wpt-commits: ad88d36028e1564673f3d34b99862c1155da81ab
wpt-pr: 37764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants