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

Issue 2365903002: Fix GDI leak in NativeThemeWin::PaintIndirect (Closed)

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

Description

Fix GDI leak in NativeThemeWin::PaintIndirect There was a GDI leak when hovering input elements. Reaching 10000 GDI objects would cause process to crash. Fixed by deleting HBITMAP that was selected onto the HDC. Deleting HDC does not take care of that. The skia utility function was removed and replaced with a custom scoped object at call site as it was used only in one place and making it safe to use for others would be a bit tricky as bitmap needs to be deleted before HDC and there is no easy access to the bitmap after utility function returns HDC. R=pkasting@chromium.org,fmalita@chromium.org,tomhudson@google.com BUG=649712 Committed: https://crrev.com/4014935dc5f26ad7517ca8427425995bd67d6c85 Cr-Commit-Position: refs/heads/master@{#421142}

Patch Set 1 #

Total comments: 6

Patch Set 2 #

Patch Set 3 : restore updated comment #

Patch Set 4 : was totally untested before this patch #

Total comments: 8

Patch Set 5 : fixup! Fix GDI leak in NativeThemeWin::PaintIndirect #

Patch Set 6 : fix comment #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -42 lines) Patch
M skia/ext/skia_utils_win.h View 1 1 chunk +0 lines, -7 lines 0 comments Download
M skia/ext/skia_utils_win.cc View 1 2 3 2 chunks +1 line, -30 lines 0 comments Download
M ui/native_theme/native_theme_win.cc View 1 2 3 4 5 3 chunks +53 lines, -5 lines 3 comments Download

Messages

Total messages: 22 (5 generated)
Rafał Chłodnicki
4 years, 3 months ago (2016-09-23 16:25:01 UTC) #1
tomhudson
lgtm Thanks for finding and fixing this.
4 years, 3 months ago (2016-09-23 16:29:10 UTC) #2
Peter Kasting
https://codereview.chromium.org/2365903002/diff/1/skia/ext/skia_utils_win.cc File skia/ext/skia_utils_win.cc (right): https://codereview.chromium.org/2365903002/diff/1/skia/ext/skia_utils_win.cc#newcode201 skia/ext/skia_utils_win.cc:201: DCHECK(bitmap); Nit: Blank line below this https://codereview.chromium.org/2365903002/diff/1/skia/ext/skia_utils_win.cc#newcode213 skia/ext/skia_utils_win.cc:213: if ...
4 years, 3 months ago (2016-09-23 18:45:00 UTC) #3
Rafał Chłodnicki
On 2016/09/23 18:45:00, Peter Kasting wrote: > https://codereview.chromium.org/2365903002/diff/1/ui/native_theme/native_theme_win.cc#newcode667 > ui/native_theme/native_theme_win.cc:667: // Bitmap needs to be ...
4 years, 3 months ago (2016-09-23 19:01:20 UTC) #4
Peter Kasting
On 2016/09/23 19:01:20, Rafał Chłodnicki wrote: > On 2016/09/23 18:45:00, Peter Kasting wrote: > > ...
4 years, 3 months ago (2016-09-23 19:09:10 UTC) #5
Rafał Chłodnicki
On 2016/09/23 19:09:10, Peter Kasting wrote: > I suggest inlining it and seeing what the ...
4 years, 3 months ago (2016-09-23 20:06:08 UTC) #6
Peter Kasting
On 2016/09/23 20:06:08, Rafał Chłodnicki wrote: > On 2016/09/23 19:09:10, Peter Kasting wrote: > > ...
4 years, 3 months ago (2016-09-23 20:15:03 UTC) #7
tomhudson
On 2016/09/23 20:06:08, Rafał Chłodnicki wrote: > The code of CreateOffscreenSurface is returning nullptr in ...
4 years, 3 months ago (2016-09-23 20:17:33 UTC) #8
Rafał Chłodnicki
On 2016/09/23 20:17:33, tomhudson wrote: > On 2016/09/23 20:06:08, Rafał Chłodnicki wrote: > > The ...
4 years, 3 months ago (2016-09-23 21:33:25 UTC) #10
Peter Kasting
https://codereview.chromium.org/2365903002/diff/60001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2365903002/diff/60001/ui/native_theme/native_theme_win.cc#newcode670 ui/native_theme/native_theme_win.cc:670: // calls fail, possibly due to GDI handle exhaustion. ...
4 years, 3 months ago (2016-09-24 00:52:34 UTC) #11
Rafał Chłodnicki
https://codereview.chromium.org/2365903002/diff/1/skia/ext/skia_utils_win.cc File skia/ext/skia_utils_win.cc (right): https://codereview.chromium.org/2365903002/diff/1/skia/ext/skia_utils_win.cc#newcode201 skia/ext/skia_utils_win.cc:201: DCHECK(bitmap); On 2016/09/23 18:45:00, Peter Kasting wrote: > Nit: ...
4 years, 2 months ago (2016-09-26 10:12:10 UTC) #12
Peter Kasting
LGTM https://codereview.chromium.org/2365903002/diff/100001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2365903002/diff/100001/ui/native_theme/native_theme_win.cc#newcode714 ui/native_theme/native_theme_win.cc:714: !DeleteObject(clip)) { Nit: {} not necessary (2 places)
4 years, 2 months ago (2016-09-26 20:58:33 UTC) #14
Rafał Chłodnicki
https://codereview.chromium.org/2365903002/diff/100001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2365903002/diff/100001/ui/native_theme/native_theme_win.cc#newcode714 ui/native_theme/native_theme_win.cc:714: !DeleteObject(clip)) { On 2016/09/26 20:58:33, Peter Kasting wrote: > ...
4 years, 2 months ago (2016-09-27 07:00:48 UTC) #17
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/2365903002/100001
4 years, 2 months ago (2016-09-27 07:00:56 UTC) #18
Peter Kasting
https://codereview.chromium.org/2365903002/diff/100001/ui/native_theme/native_theme_win.cc File ui/native_theme/native_theme_win.cc (right): https://codereview.chromium.org/2365903002/diff/100001/ui/native_theme/native_theme_win.cc#newcode714 ui/native_theme/native_theme_win.cc:714: !DeleteObject(clip)) { On 2016/09/27 07:00:48, Rafał Chłodnicki wrote: > ...
4 years, 2 months ago (2016-09-27 07:05:40 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 2 months ago (2016-09-27 07:54:21 UTC) #20
commit-bot: I haz the power
4 years, 2 months ago (2016-09-27 07:56:17 UTC) #22
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/4014935dc5f26ad7517ca8427425995bd67d6c85
Cr-Commit-Position: refs/heads/master@{#421142}

Powered by Google App Engine
This is Rietveld 408576698