Bug 146852 - Cleanup: WebCore::Pair class should use RefPtr&& instead of PassRefPtr
Summary: Cleanup: WebCore::Pair class should use RefPtr&& instead of PassRefPtr
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks: 143191
  Show dependency treegraph
 
Reported: 2015-07-10 13:30 PDT by Daniel Bates
Modified: 2015-07-10 14:06 PDT (History)
2 users (show)

See Also:


Attachments
Patch (10.86 KB, patch)
2015-07-10 13:32 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.