Bug 171485

Summary: [Cocoa] Replace uses of [get…() alloc] with alloc…Instance()
Product: WebKit Reporter: mitz
Component: New BugsAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, buildbot, commit-queue, ggaren
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Use the safer idiom none

Description mitz 2017-04-30 13:14:15 PDT
[get…() alloc] returns an id, which can lead to ambiguity, whereas alloc…Instance() returns the instance type.
Comment 1 mitz 2017-04-30 13:15:51 PDT
Created attachment 308699 [details]
Use the safer idiom
Comment 2 Build Bot 2017-04-30 13:18:32 PDT
Attachment 308699 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/network/ios/PreviewConverter.mm:51:  Missing spaces around :  [whitespace/init] [4]
ERROR: Source/WebCore/platform/network/ios/PreviewConverter.mm:56:  Missing spaces around :  [whitespace/init] [4]
Total errors found: 2 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2017-04-30 13:26:02 PDT
Comment on attachment 308699 [details]
Use the safer idiom

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

r=me

> Source/WebCore/ChangeLog:3
> +        [Cocoa] Replaces uses of [getâ¦() alloc] with allocâ¦Instance()

I think you meant "get...Class()".
Comment 4 mitz 2017-04-30 13:31:13 PDT
(In reply to Geoffrey Garen from comment #3)
> Comment on attachment 308699 [details]
> Use the safer idiom
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=308699&action=review
> 
> r=me

Thanks!

> 
> > Source/WebCore/ChangeLog:3
> > +        [Cocoa] Replaces uses of [getâ¦() alloc] with allocâ¦Instance()
> 
> I think you meant "get...Class()".

I think you meant to comment in bug 75394 :)
Comment 5 WebKit Commit Bot 2017-04-30 13:47:25 PDT
Comment on attachment 308699 [details]
Use the safer idiom

Clearing flags on attachment: 308699

Committed r215992: <http://trac.webkit.org/changeset/215992>
Comment 6 WebKit Commit Bot 2017-04-30 13:47:26 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 mitz 2017-04-30 13:53:29 PDT
(In reply to WebKit Commit Bot from comment #5)
> Comment on attachment 308699 [details]
> Use the safer idiom
> 
> Clearing flags on attachment: 308699
> 
> Committed r215992: <http://trac.webkit.org/changeset/215992>

Tried to fix the iOS build in <https://trac.webkit.org/r215993>.
Comment 8 mitz 2017-04-30 14:05:17 PDT
(In reply to mitz from comment #7)
> (In reply to WebKit Commit Bot from comment #5)
> > Comment on attachment 308699 [details]
> > Use the safer idiom
> > 
> > Clearing flags on attachment: 308699
> > 
> > Committed r215992: <http://trac.webkit.org/changeset/215992>
> 
> Tried to fix the iOS build in <https://trac.webkit.org/r215993>.

And again in <https://trac.webkit.org/r215995>.
Comment 9 Geoffrey Garen 2017-04-30 15:33:16 PDT
> > > Source/WebCore/ChangeLog:3
> > > +        [Cocoa] Replaces uses of [getâ¦() alloc] with allocâ¦Instance()
> > 
> > I think you meant "get...Class()".
> 
> I think you meant to comment in bug 75394 :)

Heh, I was trying to call attention to the missing word "Class" rather than the rendering of "...".
Comment 10 mitz 2017-04-30 15:40:51 PDT
(In reply to Geoffrey Garen from comment #9)
> > > > Source/WebCore/ChangeLog:3
> > > > +        [Cocoa] Replaces uses of [getâ¦() alloc] with allocâ¦Instance()
> > > 
> > > I think you meant "get...Class()".
> > 
> > I think you meant to comment in bug 75394 :)
> 
> Heh, I was trying to call attention to the missing word "Class" rather than
> the rendering of "...".

😮