Bug 86935 - REGRESSION(r117501): IconDatabase asserts on startup in synchronousIconForPageURL().
Summary: REGRESSION(r117501): IconDatabase asserts on startup in synchronousIconForPag...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-05-18 19:55 PDT by Andreas Kling
Modified: 2012-05-21 01:14 PDT (History)
5 users (show)

See Also:


Attachments
Pretentious patch (7.09 KB, patch)
2012-05-18 19:57 PDT, Andreas Kling
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2012-05-18 19:55:55 PDT
<rdar://problem/11480012>
Comment 1 Andreas Kling 2012-05-18 19:57:17 PDT
Created attachment 142843 [details]
Pretentious patch
Comment 2 Anders Carlsson 2012-05-18 22:51:03 PDT
Comment on attachment 142843 [details]
Pretentious patch

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

> Source/WebCore/loader/icon/IconDatabase.cpp:1529
> +        toRetain = m_urlsToRetain;
> +        toRelease = m_urlsToRelease;
> +        m_urlsToRetain.clear();
> +        m_urlsToRelease.clear();

I think you could use swap here.
Comment 3 Darin Adler 2012-05-19 16:54:12 PDT
Comment on attachment 142843 [details]
Pretentious patch

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

>> Source/WebCore/loader/icon/IconDatabase.cpp:1529
>> +        toRetain = m_urlsToRetain;
>> +        toRelease = m_urlsToRelease;
>> +        m_urlsToRetain.clear();
>> +        m_urlsToRelease.clear();
> 
> I think you could use swap here.

And a swap would be much more efficient than the assignment operator can be.

Otherwise, you could get significantly better performance using a vector rather than a counted set for the temporary copy, although there is probably not a suitable helper routine to copy the contents of a counted set into a suitably typed vector.
Comment 4 Andreas Kling 2012-05-21 00:07:04 PDT
(In reply to comment #2)
> (From update of attachment 142843 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=142843&action=review
> 
> > Source/WebCore/loader/icon/IconDatabase.cpp:1529
> > +        toRetain = m_urlsToRetain;
> > +        toRelease = m_urlsToRelease;
> > +        m_urlsToRetain.clear();
> > +        m_urlsToRelease.clear();
> 
> I think you could use swap here.

Yeah, you guys win. I'll add a swap() to HashCountedSet.
Comment 5 Andreas Kling 2012-05-21 01:14:18 PDT
Committed r117744: <http://trac.webkit.org/changeset/117744>