Bug 212642 - Pass nullptr for the 2nd argument of FileReaderLoader
Summary: Pass nullptr for the 2nd argument of FileReaderLoader
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-02 09:54 PDT by Tetsuharu Ohzeki [UTC+9]
Modified: 2020-06-02 11:11 PDT (History)
2 users (show)

See Also:


Attachments
Patch (7.96 KB, patch)
2020-06-02 09:56 PDT, Tetsuharu Ohzeki [UTC+9]
no flags Details | Formatted Diff | Diff
Patch (2.83 KB, patch)
2020-06-02 10:33 PDT, Tetsuharu Ohzeki [UTC+9]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tetsuharu Ohzeki [UTC+9] 2020-06-02 09:54:10 PDT
I seem this would make its constructor more clearly.
Comment 1 Tetsuharu Ohzeki [UTC+9] 2020-06-02 09:56:07 PDT
Created attachment 400832 [details]
Patch
Comment 2 Darin Adler 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?
Comment 3 Darin Adler 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".
Comment 4 Tetsuharu Ohzeki [UTC+9] 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?
Comment 5 Darin Adler 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.
Comment 6 Tetsuharu Ohzeki [UTC+9] 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.
Comment 7 Tetsuharu Ohzeki [UTC+9] 2020-06-02 10:33:00 PDT
Created attachment 400836 [details]
Patch
Comment 8 Tetsuharu Ohzeki [UTC+9] 2020-06-02 10:34:11 PDT
Darin, thank you!
Comment 9 EWS 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].
Comment 10 Radar WebKit Bug Importer 2020-06-02 11:11:19 PDT
<rdar://problem/63883364>