Bug 146852

Summary: Cleanup: WebCore::Pair class should use RefPtr&& instead of PassRefPtr
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 143191    
Attachments:
Description Flags
Patch none

Description Daniel Bates 2015-07-10 13:30:18 PDT
We should use RefPtr&& instead of PassRefPtr in the class definition for WebCore::Pair.
Comment 1 Daniel Bates 2015-07-10 13:32:01 PDT
Created attachment 256605 [details]
Patch
Comment 2 WebKit Commit Bot 2015-07-10 13:34:00 PDT
Attachment 256605 [details] did not pass style-queue:


ERROR: Source/WebCore/css/Pair.h:62:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebCore/css/Pair.h:63:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Daniel Bates 2015-07-10 13:35:35 PDT
Comment on attachment 256605 [details]
Patch

Clearing flags on attachment: 256605

Committed r186685: <http://trac.webkit.org/changeset/186685>
Comment 4 Daniel Bates 2015-07-10 13:35:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2015-07-10 13:41:20 PDT
Comment on attachment 256605 [details]
Patch

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

> Source/WebCore/css/Pair.h:62
> +    Pair() : m_first(nullptr), m_second(nullptr) { }

This nullptr stuff is not needed; RefPtr gets null automatically without explicit initialization. Should just be:

    Pair() { }

Assuming we can’t omit this entirely.
Comment 6 Radar WebKit Bug Importer 2015-07-10 13:47:23 PDT
<rdar://problem/21772881>
Comment 7 Daniel Bates 2015-07-10 14:06:37 PDT
(In reply to comment #5)
> Comment on attachment 256605 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=256605&action=review
> 
> > Source/WebCore/css/Pair.h:62
> > +    Pair() : m_first(nullptr), m_second(nullptr) { }
> 
> This nullptr stuff is not needed; RefPtr gets null automatically without
> explicit initialization. Should just be:
> 
>     Pair() { }
> 
> Assuming we can’t omit this entirely.

Filed bug #146856 to remove the default constructor.