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

Issue 2355423002: Harden NativeThemeWin::PaintIndirect() (Closed)

Created:
4 years, 3 months ago by tomhudson
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Harden NativeThemeWin::PaintIndirect() Speculative fix for crash observed in m54 beta. Before https://codereview.chromium.org/2182083002, any sort of setup error in PaintIndirect() would create an empty, unbacked SkCanvas; we'd run the entire painting and pixel-copying code using it, turning all the leaf operations into no-ops. The previous change to PaintIndirect() used new APIs which are pointer-based and would create NULL pointers in case of error; although we didn't expect setup errors, we're seeing crashes that suggest they are occurring in the field (possibly due to GDI handle exhaustion or running out of memory). This CL adds early exits if any of the preliminary setup steps has an error. Calling SkSurface::getCanvas() is defined as *always* returning some sort of canvas, so we leave it as a DCHECK(); the crash was happening because we were halting initilization before having a valid SkSurface to make that call against. R=fmalita@chromium.org,pkasting@chromium.org BUG=648790 Committed: https://crrev.com/7dcd512c8e7705ab266aa5593465afa4b78c4999 Cr-Commit-Position: refs/heads/master@{#420324}

Patch Set 1 #

Patch Set 2 : call *IsValid()* which will call *IsHandleValid()* #

Total comments: 2

Patch Set 3 : first pass at Peter's requested comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -1 line) Patch
M ui/native_theme/native_theme_win.cc View 1 2 1 chunk +11 lines, -1 line 0 comments Download

Messages

Total messages: 12 (5 generated)
tomhudson
Florin, Peter, PTAL; I tried to sketch the history and the suspected etiology of the ...
4 years, 3 months ago (2016-09-21 20:46:26 UTC) #2
Peter Kasting
LGTM https://codereview.chromium.org/2355423002/diff/20001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2355423002/diff/20001/ui/native_theme/native_theme_win.cc#newcode671 ui/native_theme/native_theme_win.cc:671: return; Nit: It's probably worth a comment or ...
4 years, 3 months ago (2016-09-21 20:50:44 UTC) #3
tomhudson
https://codereview.chromium.org/2355423002/diff/20001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2355423002/diff/20001/ui/native_theme/native_theme_win.cc#newcode671 ui/native_theme/native_theme_win.cc:671: return; On 2016/09/21 20:50:44, Peter Kasting wrote: > Nit: ...
4 years, 3 months ago (2016-09-21 21:19:20 UTC) #4
f(malita)
lgtm
4 years, 3 months ago (2016-09-22 12:56:04 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2355423002/40001
4 years, 3 months ago (2016-09-22 13:19:12 UTC) #8
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 3 months ago (2016-09-22 14:04:18 UTC) #10
commit-bot: I haz the power
4 years, 3 months ago (2016-09-22 14:05:39 UTC) #12
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/7dcd512c8e7705ab266aa5593465afa4b78c4999
Cr-Commit-Position: refs/heads/master@{#420324}

Powered by Google App Engine
This is Rietveld 408576698