Bug 144033 - Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
Summary: Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
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: Jinwoo Song
URL:
Keywords:
Depends on:
Blocks: 128007
  Show dependency treegraph
 
Reported: 2015-04-21 19:37 PDT by Jinwoo Song
Modified: 2015-04-22 22:27 PDT (History)
1 user (show)

See Also:


Attachments
Patch (3.97 KB, patch)
2015-04-21 19:41 PDT, Jinwoo Song
no flags Details | Formatted Diff | Diff
Patch (4.00 KB, patch)
2015-04-22 20:55 PDT, Jinwoo Song
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.