Bug 121453

Summary: Replace more uses of PassOwnPtr with OwnPtr in WebKit2
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch sam: review+

Description Anders Carlsson 2013-09-16 14:31:34 PDT
Replace more uses of PassOwnPtr with OwnPtr in WebKit2
Comment 1 Anders Carlsson 2013-09-16 14:32:50 PDT
Created attachment 211833 [details]
Patch
Comment 2 Darin Adler 2013-09-16 14:52:38 PDT
Comment on attachment 211833 [details]
Patch

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

> Source/WebKit2/Platform/CoreIPC/Connection.cpp:100
>  WTF_MAKE_NONCOPYABLE(SecondaryThreadPendingSyncReply);

I think that having an OwnPtr will automatically make the class noncopyable, so you could just omit this now.

> Source/WebKit2/Platform/CoreIPC/Connection.cpp:102
> -    SecondaryThreadPendingSyncReply() : replyDecoder(0) { }
> +    SecondaryThreadPendingSyncReply() { }

Should just omit this entirely and let the compiler generate it.

> Source/WebKit2/Platform/CoreIPC/Connection.cpp:640
> +    const auto it = m_workQueueMessageReceivers.find(message->messageReceiverName());

Why const?

> Source/WebKit2/Platform/CoreIPC/Connection.cpp:656
> +        auto it = m_waitForMessageMap.find(std::make_pair(std::make_pair(message->messageReceiverName(), message->messageName()), message->destinationID()));

You didn’t add const here, so why did you add it above?
Comment 3 Anders Carlsson 2013-09-16 14:58:01 PDT
Comment on attachment 211833 [details]
Patch

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

>> Source/WebKit2/Platform/CoreIPC/Connection.cpp:102
>> +    SecondaryThreadPendingSyncReply() { }
> 
> Should just omit this entirely and let the compiler generate it.

I tried doing that but it wouldn’t work due to the WTF_MAKE_NONCOPYABLE. I’ve removed both now.

>> Source/WebKit2/Platform/CoreIPC/Connection.cpp:640
>> +    const auto it = m_workQueueMessageReceivers.find(message->messageReceiverName());
> 
> Why const?

No good reason, I’ll remove it.
Comment 4 Anders Carlsson 2013-09-16 15:10:55 PDT
Committed r155905: <http://trac.webkit.org/changeset/155905>