Bug 230101

Summary: Add stub for File System Access API
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, annulen, beidson, benjamin, calvaris, cdumez, dvpdiner2, esprehn+autocc, ews-watchlist, gyuyoung.kim, jonlee, kondapallykalyan, ryuan.choi, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 231706    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch for landing none

Description Sihui Liu 2021-09-09 09:00:38 PDT
...
Comment 1 Sihui Liu 2021-09-09 09:03:24 PDT
Created attachment 437747 [details]
Patch
Comment 2 Sihui Liu 2021-09-09 09:18:29 PDT
Created attachment 437750 [details]
Patch
Comment 3 Sihui Liu 2021-09-09 09:36:34 PDT
Created attachment 437751 [details]
Patch
Comment 4 Sihui Liu 2021-09-09 09:58:23 PDT
Created attachment 437755 [details]
Patch
Comment 5 Sihui Liu 2021-09-09 15:50:17 PDT
Created attachment 437795 [details]
Patch
Comment 6 youenn fablet 2021-09-10 06:13:28 PDT
Comment on attachment 437795 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437795&action=review

> Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.h:56
> +    FileSystemDirectoryHandle(String&&);

explicit.

> Source/WebCore/Modules/filesystemaccess/FileSystemFileHandle.h:37
> +    struct CreateWritableOptions {

Let's add it when needed.

> Source/WebCore/Modules/filesystemaccess/FileSystemFileHandle.h:45
> +    FileSystemFileHandle(String&&);

explicit.

> Source/WebCore/Modules/filesystemaccess/FileSystemHandle.h:49
> +    FileSystemHandle(Kind, String&& name);

Since it is refcounted, it is better to move the constructor to protected.

> Source/WebCore/Modules/filesystemaccess/FileSystemHandle.idl:32
> +    EnabledBySetting=FileSystemAccess

I am not sure this has any effect on dictionaries.

> Source/WebCore/Modules/filesystemaccess/FileSystemHandle.idl:47
> +    Promise<PermissionState> requestPermission(optional FileSystemHandlePermissionDescriptor descriptor);

Are we sure we will quickly implement these two?
If not, it might be better to not include them so that feature detection works by just checking that the method is defined.
Same questions for other methods.

> Source/WebCore/Modules/filesystemaccess/FileSystemPermissionDescriptor.idl:28
> +] dictionary FileSystemPermissionDescriptor : PermissionDescriptor {

Let's add this one and related when actually needed, I do not think this is exposed to JS.
Ditto for struct FileSystemPermissionDescriptor

> Source/WebCore/Modules/filesystemaccess/FileSystemPermissionMode.h:30
> +enum class FileSystemPermissionMode : uint8_t {

could be bool I guess
Comment 7 Sihui Liu 2021-09-13 10:50:53 PDT
Created attachment 438054 [details]
Patch for landing
Comment 8 Sihui Liu 2021-09-13 10:51:37 PDT
Comment on attachment 437795 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437795&action=review

>> Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.h:56
>> +    FileSystemDirectoryHandle(String&&);
> 
> explicit.

Will add.

>> Source/WebCore/Modules/filesystemaccess/FileSystemFileHandle.h:37
>> +    struct CreateWritableOptions {
> 
> Let's add it when needed.

Okay.

>> Source/WebCore/Modules/filesystemaccess/FileSystemFileHandle.h:45
>> +    FileSystemFileHandle(String&&);
> 
> explicit.

Will add.

>> Source/WebCore/Modules/filesystemaccess/FileSystemHandle.h:49
>> +    FileSystemHandle(Kind, String&& name);
> 
> Since it is refcounted, it is better to move the constructor to protected.

Sure.

>> Source/WebCore/Modules/filesystemaccess/FileSystemHandle.idl:32
>> +    EnabledBySetting=FileSystemAccess
> 
> I am not sure this has any effect on dictionaries.

I saw other files using it on dictionary and I checked IDLAttributes.json; but it does seem to have no effect on dictionary according to CodeGenerator if I am reading it correctly

>> Source/WebCore/Modules/filesystemaccess/FileSystemHandle.idl:47
>> +    Promise<PermissionState> requestPermission(optional FileSystemHandlePermissionDescriptor descriptor);
> 
> Are we sure we will quickly implement these two?
> If not, it might be better to not include them so that feature detection works by just checking that the method is defined.
> Same questions for other methods.

I think we do; but these two may not be implemented very quickly. I will remove these two first.

>> Source/WebCore/Modules/filesystemaccess/FileSystemPermissionDescriptor.idl:28
>> +] dictionary FileSystemPermissionDescriptor : PermissionDescriptor {
> 
> Let's add this one and related when actually needed, I do not think this is exposed to JS.
> Ditto for struct FileSystemPermissionDescriptor

Sure.

>> Source/WebCore/Modules/filesystemaccess/FileSystemPermissionMode.h:30
>> +enum class FileSystemPermissionMode : uint8_t {
> 
> could be bool I guess

Will remove this file and add when it's needed.
Comment 9 EWS 2021-09-13 14:44:48 PDT
Committed r282361 (241624@main): <https://commits.webkit.org/241624@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438054 [details].
Comment 10 Radar WebKit Bug Importer 2021-09-22 13:43:16 PDT
<rdar://problem/83415609>