WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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
Details
Formatted Diff
Diff
Patch
(22.39 KB, patch)
2013-09-24 14:27 PDT
,
Anders Carlsson
no flags
Details
Formatted Diff
Diff
Patch
(22.31 KB, patch)
2013-09-24 14:32 PDT
,
Anders Carlsson
kling
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Anders Carlsson
Comment 1
2013-09-24 14:20:43 PDT
Created
attachment 212501
[details]
Patch
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
Created
attachment 212503
[details]
Patch
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
Created
attachment 212504
[details]
Patch
Anders Carlsson
Comment 6
2013-09-24 14:47:41 PDT
Committed
r156360
: <
http://trac.webkit.org/changeset/156360
>
Csaba Osztrogonác
Comment 7
2013-09-24 15:18:42 PDT
(In reply to
comment #6
)
> Committed
r156360
: <
http://trac.webkit.org/changeset/156360
>
Unix buildfix landed in
http://trac.webkit.org/changeset/156363
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug