RESOLVED FIXED 121868
Use std::unique_ptr for decoders as well
https://bugs.webkit.org/show_bug.cgi?id=121868
Summary Use std::unique_ptr for decoders as well
Anders Carlsson
Reported 2013-09-24 14:19:16 PDT
Use std::unique_ptr for decoders as well
Attachments
Patch (22.21 KB, patch)
2013-09-24 14:20 PDT, Anders Carlsson
no flags
Patch (22.39 KB, patch)
2013-09-24 14:27 PDT, Anders Carlsson
no flags
Patch (22.31 KB, patch)
2013-09-24 14:32 PDT, Anders Carlsson
kling: review+
Anders Carlsson
Comment 1 2013-09-24 14:20:43 PDT
Andreas Kling
Comment 2 2013-09-24 14:25:15 PDT
Comment on attachment 212501 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=212501&action=review > Source/WebKit2/Platform/CoreIPC/Connection.cpp:417 > - HashMap<std::pair<std::pair<StringReference, StringReference>, uint64_t>, OwnPtr<MessageDecoder>>::iterator it = m_waitForMessageMap.find(messageAndDestination); > - if (it->value) { > - OwnPtr<MessageDecoder> decoder = it->value.release(); > - m_waitForMessageMap.remove(it); > - > - return decoder.release(); > - } > + if (std::unique_ptr<MessageDecoder> decoder = m_waitForMessageMap.take(messageAndDestination)) > + return decoder; This is wrong, you are now always taking the decoder out of the map!
Anders Carlsson
Comment 3 2013-09-24 14:27:53 PDT
Andreas Kling
Comment 4 2013-09-24 14:31:52 PDT
Comment on attachment 212503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=212503&action=review > Source/WebKit2/Platform/CoreIPC/Connection.cpp:425 > - HashMap<std::pair<std::pair<StringReference, StringReference>, uint64_t>, OwnPtr<MessageDecoder>>::iterator it = m_waitForMessageMap.find(messageAndDestination); > + auto it = m_waitForMessageMap.find(messageAndDestination); > if (it->value) { > - OwnPtr<MessageDecoder> decoder = it->value.release(); > + std::unique_ptr<MessageDecoder> decoder = std::move(it->value); > m_waitForMessageMap.remove(it); > > - return decoder.release(); > + return decoder; > } > + > + if (std::unique_ptr<MessageDecoder> decoder = m_waitForMessageMap.take(messageAndDestination)) > + return decoder; Still has the bug. :|
Anders Carlsson
Comment 5 2013-09-24 14:32:39 PDT
Anders Carlsson
Comment 6 2013-09-24 14:47:41 PDT
Csaba Osztrogonác
Comment 7 2013-09-24 15:18:42 PDT
Note You need to log in before you can comment on or make changes to this bug.