Summary: | Use std::unique_ptr for decoders as well | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | ossy | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Anders Carlsson
2013-09-24 14:19:16 PDT
Created attachment 212501 [details]
Patch
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! Created attachment 212503 [details]
Patch
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. :| Created attachment 212504 [details]
Patch
Committed r156360: <http://trac.webkit.org/changeset/156360> (In reply to comment #6) > Committed r156360: <http://trac.webkit.org/changeset/156360> Unix buildfix landed in http://trac.webkit.org/changeset/156363 |