Bug 121172 - Stop using deleteAllValues in SVG code
Summary: Stop using deleteAllValues in SVG code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-11 11:25 PDT by Anders Carlsson
Modified: 2013-09-11 15:43 PDT (History)
10 users (show)

See Also:


Attachments
Patch (11.20 KB, patch)
2013-09-11 11:27 PDT, Anders Carlsson
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2013-09-11 11:25:15 PDT
Stop using deleteAllValues in SVG code
Comment 1 Anders Carlsson 2013-09-11 11:27:25 PDT
Created attachment 211333 [details]
Patch
Comment 2 Anders Carlsson 2013-09-11 11:38:26 PDT
Committed r155547: <http://trac.webkit.org/changeset/155547>
Comment 3 Anders Carlsson 2013-09-11 12:16:22 PDT
Committed r155552: <http://trac.webkit.org/changeset/155552>
Comment 4 Darin Adler 2013-09-11 15:06:41 PDT
Comment on attachment 211333 [details]
Patch

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

> Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp:150
> +        m_clipper.set(object, createOwned<ClipperData>().release());

Why release() instead of std::move?

> Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp:219
> +        m_filter.set(object, filterData.release());

Same question.

> Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp:233
> +        m_filter.set(object, filterData.release());

Same question.Same question.

> Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp:249
> +    m_filter.set(object, filterData.release());

Same question.Same question.

> Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp:77
> +        m_masker.set(object, createOwned<MaskerData>().release());

Same question.
Comment 5 Anders Carlsson 2013-09-11 15:43:40 PDT
(In reply to comment #4)
> (From update of attachment 211333 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=211333&action=review
> 
> > Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp:150
> > +        m_clipper.set(object, createOwned<ClipperData>().release());
> 
> Why release() instead of std::move?
> 

Because you can’t currently pass a move-only type as a value to HashMap. We work around this with PassOwnPtr by using the pass traits.

I hope that once we make our other collections work with move-only types we’ll be able to get rid of the pass traits.