RESOLVED FIXED 213130
FileInputType should use WeakPtr for FileListCreator lambdas
https://bugs.webkit.org/show_bug.cgi?id=213130
Summary FileInputType should use WeakPtr for FileListCreator lambdas
Andy Estes
Reported 2020-06-12 08:42:13 PDT
FileInputType should use WeakPtr for FileListCreator lambdas
Attachments
Patch (10.92 KB, patch)
2020-06-12 09:20 PDT, Andy Estes
no flags
Patch (10.91 KB, patch)
2020-06-12 09:41 PDT, Andy Estes
no flags
Patch (11.04 KB, patch)
2020-06-12 09:44 PDT, Andy Estes
no flags
Patch (10.65 KB, patch)
2020-06-12 09:56 PDT, Andy Estes
no flags
Patch (10.92 KB, patch)
2020-06-12 10:01 PDT, Andy Estes
no flags
Andy Estes
Comment 1 2020-06-12 08:42:49 PDT
Andy Estes
Comment 2 2020-06-12 09:20:13 PDT Comment hidden (obsolete)
Andy Estes
Comment 3 2020-06-12 09:41:03 PDT Comment hidden (obsolete)
Andy Estes
Comment 4 2020-06-12 09:44:16 PDT Comment hidden (obsolete)
Andy Estes
Comment 5 2020-06-12 09:56:41 PDT Comment hidden (obsolete)
Andy Estes
Comment 6 2020-06-12 10:01:42 PDT
David Kilzer (:ddkilzer)
Comment 7 2020-06-12 10:22:03 PDT
Comment on attachment 401745 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401745&action=review r=me > Source/WebCore/html/FileInputType.cpp:-107 > - if (m_fileListCreator) > - m_fileListCreator->cancel(); Should we ASSERT(!m_fileListCreator) here instead?
Andy Estes
Comment 8 2020-06-12 10:41:53 PDT
Comment on attachment 401745 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401745&action=review >> Source/WebCore/html/FileInputType.cpp:-107 >> - m_fileListCreator->cancel(); > > Should we ASSERT(!m_fileListCreator) here instead? m_fileListCreator can still be non-null here. It'd be harmless to leave these lines in, but we don't need to explicitly cancel anymore because the FileListCreator completion handler can now outlive its FileInputType (it'll immediately return when executed).
David Kilzer (:ddkilzer)
Comment 9 2020-06-12 11:04:08 PDT
Comment on attachment 401745 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401745&action=review >>> Source/WebCore/html/FileInputType.cpp:-107 >>> - m_fileListCreator->cancel(); >> >> Should we ASSERT(!m_fileListCreator) here instead? > > m_fileListCreator can still be non-null here. It'd be harmless to leave these lines in, but we don't need to explicitly cancel anymore because the FileListCreator completion handler can now outlive its FileInputType (it'll immediately return when executed). I was mostly concerned about leaks. I guess the completion handler stored on FileListCreator could leak, but that assert should be on the FileListCreator destructor.
Andy Estes
Comment 10 2020-06-12 11:33:15 PDT
(In reply to David Kilzer (:ddkilzer) from comment #9) > Comment on attachment 401745 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401745&action=review > > >>> Source/WebCore/html/FileInputType.cpp:-107 > >>> - m_fileListCreator->cancel(); > >> > >> Should we ASSERT(!m_fileListCreator) here instead? > > > > m_fileListCreator can still be non-null here. It'd be harmless to leave these lines in, but we don't need to explicitly cancel anymore because the FileListCreator completion handler can now outlive its FileInputType (it'll immediately return when executed). > > I was mostly concerned about leaks. I guess the completion handler stored > on FileListCreator could leak, but that assert should be on the > FileListCreator destructor. FileListCreator's destructor does assert that the completion handler is null.
EWS
Comment 11 2020-06-12 11:40:29 PDT
Committed r262962: <https://trac.webkit.org/changeset/262962> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401745 [details].
Note You need to log in before you can comment on or make changes to this bug.