Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1109)

Issue 9459: Make canvas code a bit more resilient to crashes.... (Closed)

Created:
12 years, 1 month ago by amit
Modified:
9 years ago
Reviewers:
brettw
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Make canvas code a bit more resilient to crashes. * Initialize PAINTSTRUCT to prevent crash if BeginPaint fails. * Sanitize width-height for empty bitmaps. * Return failure from initialize instead of crashing at that point. BUG=3795 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=4914

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -49 lines) Patch
M base/gfx/bitmap_platform_device_win.cc View 1 2 3 4 4 chunks +10 lines, -35 lines 0 comments Download
M base/gfx/platform_canvas_win.h View 1 2 3 4 3 chunks +12 lines, -5 lines 0 comments Download
M base/gfx/platform_canvas_win.cc View 1 2 3 4 3 chunks +43 lines, -6 lines 0 comments Download
M base/gfx/vector_canvas.h View 1 chunk +1 line, -1 line 0 comments Download
M base/gfx/vector_canvas.cc View 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
amit
12 years, 1 month ago (2008-11-06 18:51:37 UTC) #1
brettw
http://codereview.chromium.org/9459/diff/1/2 File base/gfx/bitmap_platform_device_win.cc (left): http://codereview.chromium.org/9459/diff/1/2#oldcode286 Line 286: CrashForBitmapAllocationFailure(width, height); I think you can now remove ...
12 years, 1 month ago (2008-11-06 18:55:23 UTC) #2
amit
Done, please take another look. On 2008/11/06 18:55:23, brettw wrote: > http://codereview.chromium.org/9459/diff/1/2 > File base/gfx/bitmap_platform_device_win.cc ...
12 years, 1 month ago (2008-11-06 19:11:17 UTC) #3
brettw
12 years, 1 month ago (2008-11-06 21:08:20 UTC) #4
LGTM.

Sorry for the duplicate comments, Reitveld is on crack.

http://codereview.chromium.org/9459/diff/20/21
File base/gfx/bitmap_platform_device_win.cc (right):

http://codereview.chromium.org/9459/diff/20/21#newcode287
Line 287: NOTREACHED() << "CreateDIBSection Failed. Error: " << error << "\n";
How about using LOG(ERROR) instead. This will give some data in release mode
(normally turned off, but runtime switchable), and NOTREACHED() is debug-only.

http://codereview.chromium.org/9459/diff/20/21#newcode287
Line 287: NOTREACHED() << "CreateDIBSection Failed. Error: " << error << "\n";
How about LOG(ERROR) here which will work in release mode as well as debug
(NOTREACHED is debug-only)

http://codereview.chromium.org/9459/diff/209/29
File base/gfx/platform_canvas_win.h (right):

http://codereview.chromium.org/9459/diff/209/29#newcode172
Line 172: // Cause a deliberate crash;
; -> .

Powered by Google App Engine
This is Rietveld 408576698