Bug 85294 - Use HashMap<OwnPtr> for CounterMap in RenderCounter
Summary: Use HashMap<OwnPtr> for CounterMap in RenderCounter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 09:57 PDT by Igor Trindade Oliveira
Modified: 2012-05-02 12:34 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.67 KB, patch)
2012-05-01 10:03 PDT, Igor Trindade Oliveira
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Trindade Oliveira 2012-05-01 09:57:37 PDT
Use HashMap<OwnPtr> for CounterMap in RenderCounter
Comment 1 Igor Trindade Oliveira 2012-05-01 10:03:11 PDT
Created attachment 139643 [details]
Patch

Proposed patch.
Comment 2 Eric Seidel (no email) 2012-05-01 10:30:57 PDT
Comment on attachment 139643 [details]
Patch

Seems reasonable.  I believe it's safe to use an OwnPtr as a HashMap value.
Comment 3 WebKit Review Bot 2012-05-01 10:39:30 PDT
Comment on attachment 139643 [details]
Patch

Clearing flags on attachment: 139643

Committed r115736: <http://trac.webkit.org/changeset/115736>
Comment 4 WebKit Review Bot 2012-05-01 10:39:35 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2012-05-02 12:34:39 PDT
Comment on attachment 139643 [details]
Patch

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

> Source/WebCore/rendering/RenderCounter.cpp:443
>          nodeMap = new CounterMap;
> -        counterMaps().set(object, nodeMap);
> +        counterMaps().set(object, adoptPtr(nodeMap));

It would have been better to do a version of this where the adoptPtr and the new are on the same line of code.