Bug 213259

Summary: FileListCreator should only be used for resolving directories
Product: WebKit Reporter: Andy Estes <aestes>
Component: FormsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, ddkilzer, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=213130
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Andy Estes 2020-06-16 13:58:12 PDT
FileListCreator should only be used for resolving directories
Comment 1 Andy Estes 2020-06-16 13:59:27 PDT
rdar://problem/64375709
Comment 2 Andy Estes 2020-06-16 15:08:17 PDT Comment hidden (obsolete)
Comment 3 Andy Estes 2020-06-16 15:54:07 PDT
Created attachment 402051 [details]
Patch
Comment 4 David Kilzer (:ddkilzer) 2020-06-16 17:11:03 PDT
Comment on attachment 402051 [details]
Patch

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

> Source/WebCore/html/FileInputType.cpp:427
> +    m_directoryFileListCreator = DirectoryFileListCreator::create([this, weakThis = makeWeakPtr(*this), icon = makeRefPtr(icon)](Ref<FileList>&& fileList) mutable {
> +        if (!weakThis)
>              return;
> -        setFiles(WTFMove(fileList), icon ? RequestIcon::Yes : RequestIcon::No);
> -        if (icon && !m_fileList->isEmpty() && element())
> -            iconLoaded(WTFMove(icon));
> -        m_fileListCreator = nullptr;
> +        didCreateFileList(WTFMove(fileList), WTFMove(icon));
>      });

Worth adding an ASSERT() that this runs on the main thread?  (Does not have to be addressed to land this since it wasn't present before.)
Comment 5 Andy Estes 2020-06-16 17:15:29 PDT
Comment on attachment 402051 [details]
Patch

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

>> Source/WebCore/html/FileInputType.cpp:427
>>      });
> 
> Worth adding an ASSERT() that this runs on the main thread?  (Does not have to be addressed to land this since it wasn't present before.)

👍
Comment 6 Andy Estes 2020-06-16 17:25:01 PDT
Created attachment 402059 [details]
Patch
Comment 7 EWS 2020-06-16 17:47:15 PDT
Committed r263129: <https://trac.webkit.org/changeset/263129>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402059 [details].