RESOLVED FIXED 114984
[CSS Exclusions] Improve ExclusionPolygon smart pointer safety
https://bugs.webkit.org/show_bug.cgi?id=114984
Summary [CSS Exclusions] Improve ExclusionPolygon smart pointer safety
Hans Muller
Reported 2013-04-22 12:31:18 PDT
Eric Seidel pointed out a small stylo and a lack of smart pointer safety in ExclusionPolygon.cpp, here: https://codereview.chromium.org/14220005/.
Attachments
Patch (5.02 KB, patch)
2013-04-22 15:46 PDT, Hans Muller
no flags
Patch (5.04 KB, patch)
2013-04-22 16:25 PDT, Hans Muller
no flags
Hans Muller
Comment 1 2013-04-22 15:46:22 PDT
Created attachment 199121 [details] Patch Assign newly allocated objects to PassOwnPtrs as early as possible to reduce the chances of future leaks. No new tests were added, this change adds no new functionality.
WebKit Commit Bot
Comment 2 2013-04-22 15:48:26 PDT
Attachment 199121 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/rendering/ExclusionPolygon.cpp', u'Source/WebCore/rendering/ExclusionShape.cpp']" exit_code: 1 Source/WebCore/rendering/ExclusionPolygon.cpp:140: Local variables should never be PassOwnPtr (see http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5] Source/WebCore/rendering/ExclusionPolygon.cpp:161: Local variables should never be PassOwnPtr (see http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5] Source/WebCore/rendering/ExclusionShape.cpp:151: Local variables should never be PassOwnPtr (see http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5] Total errors found: 3 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Hans Muller
Comment 3 2013-04-22 16:25:11 PDT
Created attachment 199128 [details] Patch Use OwnPtr for local variables and explicitly convert them to PassOwnPtr with release().
Dirk Schulze
Comment 4 2013-04-23 15:05:30 PDT
Comment on attachment 199128 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=199128&action=review r=me. > Source/WebCore/rendering/ExclusionShape.cpp:159 > + exclusionShape = createExclusionPolygon(vertices.release(), polygon->windRule()); I am not necessarily loving it that the vertices are created here and passed from one ctor to the next multiple times, but this particular change seems reasonable.
WebKit Commit Bot
Comment 5 2013-04-23 15:42:13 PDT
Comment on attachment 199128 [details] Patch Clearing flags on attachment: 199128 Committed r149003: <http://trac.webkit.org/changeset/149003>
WebKit Commit Bot
Comment 6 2013-04-23 15:42:14 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.