Bug 213259 - FileListCreator should only be used for resolving directories
Summary: FileListCreator should only be used for resolving directories
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-16 13:58 PDT by Andy Estes
Modified: 2020-06-16 17:47 PDT (History)
9 users (show)

See Also:


Attachments
Patch (27.53 KB, patch)
2020-06-16 15:08 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (27.53 KB, patch)
2020-06-16 15:54 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (27.56 KB, patch)
2020-06-16 17:25 PDT, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].