diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-24 17:22:26 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-24 17:22:26 +0000 |
commit | 3d805c350c9dc431d71e9156fbbff0b330be4717 (patch) | |
tree | 4ac7984076ae3c968589d97bc7b70e10d871c877 /chrome/browser/views | |
parent | 65776ee227785343f00145060f6ff0b355e133f1 (diff) | |
download | chromium_src-3d805c350c9dc431d71e9156fbbff0b330be4717.zip chromium_src-3d805c350c9dc431d71e9156fbbff0b330be4717.tar.gz chromium_src-3d805c350c9dc431d71e9156fbbff0b330be4717.tar.bz2 |
Remove use of Skia's safeUnref() in favor of SkSafeUnref(...)
safeUnref() technically has undefined behavior on a null pointer.
TEST=green bots
BUG=none
Review URL: http://codereview.chromium.org/3475007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/detachable_toolbar_view.cc | 14 | ||||
-rw-r--r-- | chrome/browser/views/sad_tab_view.cc | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/chrome/browser/views/detachable_toolbar_view.cc b/chrome/browser/views/detachable_toolbar_view.cc index 796425f..e2aaa3a 100644 --- a/chrome/browser/views/detachable_toolbar_view.cc +++ b/chrome/browser/views/detachable_toolbar_view.cc @@ -97,10 +97,10 @@ void DetachableToolbarView::PaintVerticalDivider( const SkColor& bottom_color) { // Draw the upper half of the divider. SkPaint paint; - paint.setShader(gfx::CreateGradientShader(vertical_padding + 1, - height / 2, - top_color, - middle_color))->safeUnref(); + SkSafeUnref(paint.setShader(gfx::CreateGradientShader(vertical_padding + 1, + height / 2, + top_color, + middle_color))); SkRect rc = { SkIntToScalar(x), SkIntToScalar(vertical_padding + 1), SkIntToScalar(x + 1), @@ -109,10 +109,8 @@ void DetachableToolbarView::PaintVerticalDivider( // Draw the lower half of the divider. SkPaint paint_down; - paint_down.setShader(gfx::CreateGradientShader(height / 2, - height - vertical_padding, - middle_color, - bottom_color))->safeUnref(); + SkSafeUnref(paint_down.setShader(gfx::CreateGradientShader( + height / 2, height - vertical_padding, middle_color, bottom_color))); SkRect rc_down = { SkIntToScalar(x), SkIntToScalar(height / 2), SkIntToScalar(x + 1), diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc index 680e7d3..31f45fd 100644 --- a/chrome/browser/views/sad_tab_view.cc +++ b/chrome/browser/views/sad_tab_view.cc @@ -54,9 +54,9 @@ SadTabView::SadTabView(TabContents* tab_contents) void SadTabView::Paint(gfx::Canvas* canvas) { SkPaint paint; - paint.setShader(gfx::CreateGradientShader(0, height(), - kBackgroundColor, - kBackgroundEndColor))->safeUnref(); + SkSafeUnref(paint.setShader(gfx::CreateGradientShader(0, height(), + kBackgroundColor, + kBackgroundEndColor))); paint.setStyle(SkPaint::kFill_Style); canvas->AsCanvasSkia()->drawRectCoords( 0, 0, SkIntToScalar(width()), SkIntToScalar(height()), paint); |