Bug 131457 - Remove unnecessary uses of std::move() in return statements
Summary: Remove unnecessary uses of std::move() in return statements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-09 14:53 PDT by Zan Dobersek
Modified: 2014-04-13 09:34 PDT (History)
1 user (show)

See Also:


Attachments
Patch (7.46 KB, patch)
2014-04-09 14:56 PDT, Zan Dobersek
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2014-04-09 14:53:29 PDT
Remove unnecessary uses of std::move() in return statements
Comment 1 Zan Dobersek 2014-04-09 14:56:05 PDT
Created attachment 228987 [details]
Patch
Comment 2 Darin Adler 2014-04-12 12:37:03 PDT
Comment on attachment 228987 [details]
Patch

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

> Source/WebCore/platform/RemoteCommandListener.cpp:34
> +    return std::unique_ptr<RemoteCommandListener>(new RemoteCommandListener(client));

This needs to use make_unique, not unique_ptr/new.

> Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm:44
> +    return std::unique_ptr<RemoteCommandListener>(new RemoteCommandListenerIOS(client));

This needs to use make_unique, not unique_ptr/new.
Comment 3 Zan Dobersek 2014-04-13 07:19:49 PDT
Committed r167196: <http://trac.webkit.org/changeset/167196>
Comment 4 Zan Dobersek 2014-04-13 09:34:16 PDT
Comment on attachment 228987 [details]
Patch

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

>> Source/WebCore/platform/RemoteCommandListener.cpp:34
>> +    return std::unique_ptr<RemoteCommandListener>(new RemoteCommandListener(client));
> 
> This needs to use make_unique, not unique_ptr/new.

I managed to break the build by using std::make_unique() without the constructor being public, but I reverted back to using the std::unique_ptr<RemoteCommandListener> constructor rather than making the constructor accessible. Doing that wouldn't make much sense with RemoteCommandListener::create() set up to elegantly return an object of specific class on the iOS platform and an object of the general class on other platforms.

I'd rather address this once it becomes trivial to declare std::make_unique<>() as a friend of some specific class.