Bug 122904 - Add PassRef and createRefCounted so we can improve creation of RefCounted objects
Summary: Add PassRef and createRefCounted so we can improve creation of RefCounted obj...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-16 09:43 PDT by Darin Adler
Modified: 2013-10-21 09:44 PDT (History)
5 users (show)

See Also:


Attachments
Patch (35.46 KB, patch)
2013-10-16 09:54 PDT, Darin Adler
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2013-10-16 09:43:08 PDT
Add PassRef and createRefCounted so we can improve creation of RefCounted objects
Comment 1 Darin Adler 2013-10-16 09:54:59 PDT
Created attachment 214367 [details]
Patch
Comment 2 WebKit Commit Bot 2013-10-16 09:57:30 PDT
Attachment 214367 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/GNUmakefile.list.am', u'Source/WTF/WTF.vcxproj/WTF.vcxproj', u'Source/WTF/WTF.vcxproj/WTF.vcxproj.filters', u'Source/WTF/WTF.xcodeproj/project.pbxproj', u'Source/WTF/wtf/CMakeLists.txt', u'Source/WTF/wtf/Forward.h', u'Source/WTF/wtf/PassRef.h', u'Source/WTF/wtf/PassRefPtr.h', u'Source/WTF/wtf/Ref.h', u'Source/WTF/wtf/RefPtr.h', u'Source/WTF/wtf/StdLibExtras.h', u'Tools/ChangeLog', u'Tools/TestWebKitAPI/Tests/WTF/Ref.cpp']" exit_code: 1
Source/WTF/wtf/PassRef.h:41:  Missing spaces around &&  [whitespace/operators] [3]
Source/WTF/wtf/PassRef.h:127:  Missing spaces around &&  [whitespace/operators] [3]
Source/WTF/wtf/StdLibExtras.h:94:  reinterpret_cast_ptr is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/StdLibExtras.h:101:  reinterpret_cast_ptr is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 4 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Adler 2013-10-16 10:16:27 PDT
Committed r157520: <http://trac.webkit.org/changeset/157520>
Comment 4 Mikhail Pozdnyakov 2013-10-21 07:13:57 PDT
Comment on attachment 214367 [details]
Patch

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

> Source/WTF/wtf/PassRef.h:185
> +{

Could we use variadic templates instead?
Comment 5 Darin Adler 2013-10-21 09:44:23 PDT
Comment on attachment 214367 [details]
Patch

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

>> Source/WTF/wtf/PassRef.h:185
>> +{
> 
> Could we use variadic templates instead?

We do. You are have put this comment within the #else side of #if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) that starts on line 125 above. If you look there you can see the much simpler version using variadic templates for compilers that support it.