Bug 121172

Summary: Stop using deleteAllValues in SVG code
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, dino, d-r, esprehn+autocc, fmalita, glenn, kondapallykalyan, pdr, schenney
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch koivisto: review+

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.