Bug 46312

Summary: Skia's safeRef() and safeUnref() functions are undefined on NULL pointers.
Product: WebKit Reporter: Steve VanDeBogart <vandebo>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Trivial CC: abarth, eric, levin, webkit.review.bot
Priority: P5    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Use SkSafeRef/Unref instead of safeRef/Unref
none
grep missed saveRef, fixed.
levin: review+
Use 0 instead of NULL in comment to appease style bot.
none
Fill in reviewer none

Description Steve VanDeBogart 2010-09-22 15:01:21 PDT
Skia's safeRef() and safeUnref() functions are undefined on NULL pointers.  SkSafeRef() and SkSafeUnref() should be used instead.  Patch forthcoming.
Comment 1 Steve VanDeBogart 2010-09-22 15:06:57 PDT
Created attachment 68450 [details]
Use SkSafeRef/Unref instead of safeRef/Unref
Comment 2 David Levin 2010-09-22 15:55:43 PDT
Comment on attachment 68450 [details]
Use SkSafeRef/Unref instead of safeRef/Unref

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

> WebCore/platform/graphics/skia/PlatformContextSkia.cpp:165
>      // Up the ref count of these. saveRef does nothing if 'this' is NULL.

This comment is incorrect. Please update.
Comment 3 Steve VanDeBogart 2010-09-22 16:33:18 PDT
Created attachment 68470 [details]
grep missed saveRef, fixed.
Comment 4 WebKit Review Bot 2010-09-22 16:34:34 PDT
Attachment 68470 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/platform/graphics/skia/PlatformContextSkia.cpp:165:  Use 0 instead of NULL.  [readability/null] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Eric Seidel (no email) 2010-09-23 03:17:48 PDT
Comment on attachment 68450 [details]
Use SkSafeRef/Unref instead of safeRef/Unref

Cleared David Levin's review+ from obsolete attachment 68450 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 6 David Levin 2010-09-23 07:53:17 PDT
Comment on attachment 68470 [details]
grep missed saveRef, fixed.

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

> WebCore/platform/graphics/skia/PlatformContextSkia.cpp:165
> +    // Up the ref count of these. SkSafeRef does nothing if its argument is NULL.

Use 0 instead of NULL.
Comment 7 David Levin 2010-09-23 07:55:03 PDT
Why did this get put up for review again just to fix a comment?

If you want to use the commit queue, then just attach the patch as if you were going to land it (with the reviewer filled in and nits fixed). Then just mark the patch as cq+ (or get any committer to do so). No need for a new review :)
Comment 8 Steve VanDeBogart 2010-09-23 09:39:49 PDT
Created attachment 68530 [details]
Use 0 instead of NULL in comment to appease style bot.
Comment 9 Steve VanDeBogart 2010-09-23 09:41:48 PDT
Created attachment 68531 [details]
Fill in reviewer
Comment 10 Steve VanDeBogart 2010-09-23 09:42:45 PDT
Sorry, I infrequently submit webkit patches.
Comment 11 Steve VanDeBogart 2010-09-23 11:00:33 PDT
Landed by jhawkins as r68165.