Bug 212642

Summary: Pass nullptr for the 2nd argument of FileReaderLoader
Product: WebKit Reporter: Tetsuharu Ohzeki [UTC+9] <tetsuharu.ohzeki>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Tetsuharu Ohzeki [UTC+9]
Reported 2020-06-02 09:54:10 PDT
I seem this would make its constructor more clearly.
Attachments
Patch (7.96 KB, patch)
2020-06-02 09:56 PDT, Tetsuharu Ohzeki [UTC+9]
no flags
Patch (2.83 KB, patch)
2020-06-02 10:33 PDT, Tetsuharu Ohzeki [UTC+9]
no flags
Tetsuharu Ohzeki [UTC+9]
Comment 1 2020-06-02 09:56:07 PDT
Darin Adler
Comment 2 2020-06-02 10:02:05 PDT
Comment on attachment 400832 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400832&action=review > Source/WebCore/ChangeLog:3 > + Use WTF::Optional for the 2nd argument of FileReaderLoader Why?
Darin Adler
Comment 3 2020-06-02 10:02:29 PDT
Comment on attachment 400832 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400832&action=review >> Source/WebCore/ChangeLog:3 >> + Use WTF::Optional for the 2nd argument of FileReaderLoader > > Why? Pointers are intrinsically "optional" and we use nullptr to mean "no value".
Tetsuharu Ohzeki [UTC+9]
Comment 4 2020-06-02 10:18:46 PDT
(In reply to Darin Adler from comment #3) > Comment on attachment 400832 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=400832&action=review > > >> Source/WebCore/ChangeLog:3 > >> + Use WTF::Optional for the 2nd argument of FileReaderLoader > > > > Why? > > Pointers are intrinsically "optional" and we use nullptr to mean "no value". I know it. First, I had thought replacing this `0` to `nullptr`. https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/fileapi/FileReaderSync.cpp#L48 But I think it maybe better to use WTF::Optional. To make it more simply, Is replacing nullptr best?
Darin Adler
Comment 5 2020-06-02 10:19:31 PDT
(In reply to Tetsuharu Ohzeki from comment #4) > To make it more simply, Is replacing nullptr best? Yes, I think so.
Tetsuharu Ohzeki [UTC+9]
Comment 6 2020-06-02 10:22:00 PDT
(In reply to Darin Adler from comment #5) > (In reply to Tetsuharu Ohzeki from comment #4) > > To make it more simply, Is replacing nullptr best? > > Yes, I think so. Okay. I'll change so.
Tetsuharu Ohzeki [UTC+9]
Comment 7 2020-06-02 10:33:00 PDT
Tetsuharu Ohzeki [UTC+9]
Comment 8 2020-06-02 10:34:11 PDT
Darin, thank you!
EWS
Comment 9 2020-06-02 11:10:58 PDT
Committed r262430: <https://trac.webkit.org/changeset/262430> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400836 [details].
Radar WebKit Bug Importer
Comment 10 2020-06-02 11:11:19 PDT
Note You need to log in before you can comment on or make changes to this bug.