Bug 144033

Summary: Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
Product: WebKit Reporter: Jinwoo Song <jinwoo7.song>
Component: New BugsAssignee: Jinwoo Song <jinwoo7.song>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 128007    
Attachments:
Description Flags
Patch
none
Patch none

Description Jinwoo Song 2015-04-21 19:37:25 PDT
Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
Comment 1 Jinwoo Song 2015-04-21 19:41:16 PDT
Created attachment 251296 [details]
Patch
Comment 2 Darin Adler 2015-04-22 09:13:22 PDT
Comment on attachment 251296 [details]
Patch

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

> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:961
> +        std::unique_ptr<cairo_path_t, void(*)(cairo_path_t*)> pathCopy(cairo_copy_path(path.platformPath()->context()), [](cairo_path_t* path) {
> +            cairo_path_destroy(path);
> +        });
>          cairo_append_path(cr, pathCopy.get());

In this three-line sequence, I don’t see the benefit of using unique_ptr rather than just using cairo_path_destroy in a normal way.
Comment 3 Jinwoo Song 2015-04-22 20:54:41 PDT
Comment on attachment 251296 [details]
Patch

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

>> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:961
>>          cairo_append_path(cr, pathCopy.get());
> 
> In this three-line sequence, I don’t see the benefit of using unique_ptr rather than just using cairo_path_destroy in a normal way.

You're definitely right! I'll update the patch as your recommendation.
Comment 4 Jinwoo Song 2015-04-22 20:55:55 PDT
Created attachment 251400 [details]
Patch

Applied Darin's comment.
Comment 5 WebKit Commit Bot 2015-04-22 22:27:39 PDT
Comment on attachment 251400 [details]
Patch

Clearing flags on attachment: 251400

Committed r183170: <http://trac.webkit.org/changeset/183170>
Comment 6 WebKit Commit Bot 2015-04-22 22:27:42 PDT
All reviewed patches have been landed.  Closing bug.