@@ -197,7 +197,7 @@ Each [=/file system locator=] has an associated <dfn export for="file system loc
197
197
a <dfn export for="file system locator" id=locator-kind>kind</dfn> (a {{FileSystemHandleKind}} ), and
198
198
a <dfn export for="file system locator" id=locator-root>root</dfn> (a [=file system root=] ).
199
199
200
- Issue(103 ): Consider giving each locator a Storage Bucket .
200
+ Issue(109 ): Consider giving each locator a [=storage bucket=] .
201
201
202
202
A <dfn export>file locator</dfn> is a [=/file system locator=] whose
203
203
[=file system locator/kind=] is {{FileSystemHandleKind/"file"}} .
@@ -297,6 +297,20 @@ A {{FileSystemHandle}} object is associated with a <dfn for=FileSystemHandle exp
297
297
Note: Multiple {{FileSystemHandle}} objects can have
298
298
[=the same locator as|the same=] [=/file system locator=] .
299
299
300
+ A {{FileSystemHandle}}
301
+ <dfn for=FileSystemHandle export>is in an origin private file system</dfn>
302
+ if the first [=list/item=] of its [=FileSystemHandle/locator=] 's
303
+ [=file system locator/path=] is the empty string.
304
+
305
+ Note: This is a bit magical, but it works since only the root directory of an
306
+ [=origin private file system=] can have a [=file system locator/path=] which
307
+ [=list/contains=] an empty string. See {{StorageManager/getDirectory()}} .
308
+ All other [=list/item=] s of a [=file system locator/path=] will be a
309
+ [=valid file name=] .
310
+
311
+ Issue(109): Consider improving this situation by giving each locator a
312
+ [=storage bucket=] .
313
+
300
314
<div algorithm="serialization steps">
301
315
{{FileSystemHandle}} objects are [=serializable objects=] .
302
316
@@ -535,15 +549,17 @@ The <dfn method for=FileSystemFileHandle>createWritable(|options|)</dfn> method
535
549
The returned {{FileSystemSyncAccessHandle}} offers synchronous methods. This allows for higher performance
536
550
on contexts where asynchronous operations come with high overhead, e.g., WebAssembly.
537
551
538
- For the time being, this method will only succeed when the |fileHandle| belongs to the
539
- [=origin private file system=] .
552
+ For the time being, this method will only succeed when the |fileHandle|
553
+ [=FileSystemHandle/is in an origin private file system=] .
540
554
</div>
541
555
542
556
<div algorithm>
543
557
The <dfn method for=FileSystemFileHandle>createSyncAccessHandle()</dfn> method steps are:
544
558
545
559
1. Let |result| be [=a new promise=] .
546
560
1. Let |locator| be [=this=] 's [=FileSystemHandle/locator=] .
561
+ 1. Let |isInOriginPrivateFileSystem| be whether
562
+ [=this=] [=FileSystemHandle/is in an origin private file system=] .
547
563
1. Run these steps [=in parallel=] :
548
564
1. Let |entry| be the result of [=locating an entry=] given |locator|.
549
565
1. Let |access| be the result of running |entry|'s
@@ -552,12 +568,13 @@ The <dfn method for=FileSystemFileHandle>createSyncAccessHandle()</dfn> method s
552
568
1. If |access| is not "{{PermissionState/granted}} ",
553
569
[=reject=] |result| with a "{{NotAllowedError}} " {{DOMException}} and abort.
554
570
571
+ 1. If |isInOriginPrivateFileSystem| is true, [=reject=] |result|
572
+ with an "{{InvalidStateError}} " {{DOMException}} and abort.
573
+
555
574
1. If |entry| is `null`, [=/reject=] |result| with a
556
575
"{{NotFoundError}} " {{DOMException}} and abort.
557
576
1. [=Assert=] : |entry| is a [=file entry=] .
558
577
559
- 1. If |entry| does not represent a [=/file system entry=] in an [=origin private file system=] ,
560
- [=reject=] |result| with an "{{InvalidStateError}} " {{DOMException}} and abort.
561
578
1. Let |lockResult| be the result of [=file entry/lock/take|taking a lock=] with "`exclusive`" on |entry|.
562
579
1. If |lockResult| is false, [=reject=] |result| with a "{{NoModificationAllowedError}} " {{DOMException}} and abort.
563
580
1. Let |handle| be the result of <a>creating a new `FileSystemSyncAccessHandle`</a>
@@ -1525,7 +1542,7 @@ partial interface StorageManager {
1525
1542
1526
1543
<div class="note domintro">
1527
1544
: |directoryHandle| = await navigator . storage . {{StorageManager/getDirectory()}}
1528
- :: Returns the root directory of the origin private file system.
1545
+ :: Returns the root directory of the [= origin private file system=] .
1529
1546
</div>
1530
1547
1531
1548
<div algorithm>
0 commit comments