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

Issue 1406403007: Eliminate HICON leaks caused by creating icons from bitmap image. (Closed)

Created:
5 years, 1 month ago by anpol
Modified:
5 years ago
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Eliminate HICON leaks caused by creating icons from bitmap image. Every icon handle created by CreateHICONFromSkBitmap() should become immediately owned by its creator. We use base::win::ScopedHICON to control the icon's lifetime. R=sky@chromium.org BUG= Committed: https://crrev.com/280746cce16d03242f855c4c795a62b7349f38d4 Cr-Commit-Position: refs/heads/master@{#366055}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add move semantics to ScopedGDIObject. #

Total comments: 3

Patch Set 3 : Use nullptr in ScopedGDIObject. Extend previous icon lifetime. #

Patch Set 4 : Fix nullptr issue in ScopedGDIObject. #

Total comments: 2

Patch Set 5 : Use ScopedGeneric to define ScopedGDIObject. #

Total comments: 3

Patch Set 6 : Use ScopedHICON instead of HICON. #

Total comments: 8

Patch Set 7 : Remove redundant Pass() calls #

Patch Set 8 : Fix compile errors. #

Patch Set 9 : Rebase #

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -231 lines) Patch
M base/win/scoped_gdi_object.h View 1 2 3 4 5 1 chunk +15 lines, -47 lines 0 comments Download
M chrome/browser/ui/views/frame/glass_browser_frame_view.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/glass_browser_frame_view.cc View 1 2 3 4 5 6 7 8 9 4 chunks +34 lines, -25 lines 0 comments Download
M chrome/browser/ui/views/frame/taskbar_decorator_win.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/panels/panel_frame_view.cc View 1 2 3 4 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/status_icons/status_icon_win.cc View 1 2 3 4 5 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/tabs/window_finder_win.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/renderer_host/pepper/pepper_truetype_font_win.cc View 1 2 3 4 5 6 7 8 4 chunks +22 lines, -21 lines 0 comments Download
M content/common/cursors/webcursor_aurawin.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M printing/emf_win.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M printing/image_win.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M remoting/host/desktop_shape_tracker_win.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -6 lines 0 comments Download
M remoting/host/disconnect_window_win.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/icon_util.h View 1 2 3 4 5 6 7 8 4 chunks +9 lines, -11 lines 0 comments Download
M ui/gfx/icon_util.cc View 1 2 3 4 5 6 7 8 8 chunks +17 lines, -17 lines 0 comments Download
M ui/gfx/icon_util_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +33 lines, -38 lines 0 comments Download
M ui/gfx/path_win.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M ui/gfx/path_win_unittest.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M ui/gfx/platform_font_win.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M ui/native_theme/native_theme_win.cc View 1 2 3 4 5 6 7 8 9 4 chunks +7 lines, -5 lines 0 comments Download
M ui/views/controls/menu/menu_config_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ui/views/win/hwnd_message_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 2 3 4 5 6 7 8 9 8 chunks +24 lines, -28 lines 0 comments Download

Messages

Total messages: 42 (14 generated)
anpol
5 years, 1 month ago (2015-11-02 09:31:59 UTC) #1
anpol
5 years, 1 month ago (2015-11-02 09:50:15 UTC) #2
sky
https://codereview.chromium.org/1406403007/diff/1/chrome/browser/ui/views/frame/glass_browser_frame_view.cc File chrome/browser/ui/views/frame/glass_browser_frame_view.cc (right): https://codereview.chromium.org/1406403007/diff/1/chrome/browser/ui/views/frame/glass_browser_frame_view.cc#newcode590 chrome/browser/ui/views/frame/glass_browser_frame_view.cc:590: small_window_icon_.Set(small_icon); Won't this be problematic with the code on ...
5 years, 1 month ago (2015-11-02 16:41:38 UTC) #3
anpol
On 2015/11/02 16:41:38, sky wrote: > https://codereview.chromium.org/1406403007/diff/1/chrome/browser/ui/views/frame/glass_browser_frame_view.cc#newcode590 > chrome/browser/ui/views/frame/glass_browser_frame_view.cc:590: > small_window_icon_.Set(small_icon); > Won't this be ...
5 years, 1 month ago (2015-11-03 12:38:42 UTC) #7
anpol
Add move semantics to ScopedGDIObject.
5 years, 1 month ago (2015-11-03 12:39:52 UTC) #8
sky
https://codereview.chromium.org/1406403007/diff/20001/base/win/scoped_gdi_object.h File base/win/scoped_gdi_object.h (right): https://codereview.chromium.org/1406403007/diff/20001/base/win/scoped_gdi_object.h#newcode26 base/win/scoped_gdi_object.h:26: // Constructor that takes ownership of an object. This ...
5 years, 1 month ago (2015-11-03 17:23:16 UTC) #9
anpol
PTAL
5 years, 1 month ago (2015-11-04 11:20:36 UTC) #10
sky
LGTM
5 years, 1 month ago (2015-11-04 16:21:14 UTC) #11
anpol
scoped_gdi_object.h is to be reviewed.
5 years, 1 month ago (2015-11-06 19:43:40 UTC) #13
grt (UTC plus 2)
https://codereview.chromium.org/1406403007/diff/60001/base/win/scoped_gdi_object.h File base/win/scoped_gdi_object.h (right): https://codereview.chromium.org/1406403007/diff/60001/base/win/scoped_gdi_object.h#newcode19 base/win/scoped_gdi_object.h:19: class ScopedGDIObject { can you implement this in terms ...
5 years, 1 month ago (2015-11-06 19:49:20 UTC) #14
anpol
https://codereview.chromium.org/1406403007/diff/60001/base/win/scoped_gdi_object.h File base/win/scoped_gdi_object.h (right): https://codereview.chromium.org/1406403007/diff/60001/base/win/scoped_gdi_object.h#newcode19 base/win/scoped_gdi_object.h:19: class ScopedGDIObject { On 2015/11/06 19:49:20, grt wrote: > ...
5 years, 1 month ago (2015-11-06 20:28:16 UTC) #15
grt (UTC plus 2)
On 2015/11/06 20:28:16, anpol wrote: > https://codereview.chromium.org/1406403007/diff/60001/base/win/scoped_gdi_object.h > File base/win/scoped_gdi_object.h (right): > > https://codereview.chromium.org/1406403007/diff/60001/base/win/scoped_gdi_object.h#newcode19 > ...
5 years, 1 month ago (2015-11-06 20:37:28 UTC) #16
anpol
13 more files updated, PTAL.
5 years, 1 month ago (2015-11-09 10:48:12 UTC) #18
grt (UTC plus 2)
https://codereview.chromium.org/1406403007/diff/80001/ui/gfx/icon_util.cc File ui/gfx/icon_util.cc (right): https://codereview.chromium.org/1406403007/diff/80001/ui/gfx/icon_util.cc#newcode166 ui/gfx/icon_util.cc:166: HICON IconUtil::CreateHICONFromSkBitmap(const SkBitmap& bitmap) { It seems safest for ...
5 years, 1 month ago (2015-11-09 16:55:39 UTC) #19
anpol
https://codereview.chromium.org/1406403007/diff/80001/ui/gfx/icon_util.cc File ui/gfx/icon_util.cc (right): https://codereview.chromium.org/1406403007/diff/80001/ui/gfx/icon_util.cc#newcode166 ui/gfx/icon_util.cc:166: HICON IconUtil::CreateHICONFromSkBitmap(const SkBitmap& bitmap) { On 2015/11/09 16:55:39, grt ...
5 years, 1 month ago (2015-11-10 15:40:23 UTC) #20
grt (UTC plus 2)
https://codereview.chromium.org/1406403007/diff/100001/chrome/browser/ui/views/frame/glass_browser_frame_view.cc File chrome/browser/ui/views/frame/glass_browser_frame_view.cc (right): https://codereview.chromium.org/1406403007/diff/100001/chrome/browser/ui/views/frame/glass_browser_frame_view.cc#newcode77 chrome/browser/ui/views/frame/glass_browser_frame_view.cc:77: .Pass(); can this be removed? https://codereview.chromium.org/1406403007/diff/100001/ui/gfx/icon_util.cc File ui/gfx/icon_util.cc (right): ...
5 years, 1 month ago (2015-11-10 16:44:43 UTC) #21
anpol
Removing redundant Pass() calls.
5 years, 1 month ago (2015-11-11 06:12:25 UTC) #22
grt (UTC plus 2)
please fix compile errors
5 years, 1 month ago (2015-11-11 17:36:02 UTC) #23
cpu_(ooo_6.6-7.5)
Thanks for doing this! I think grt@ has you covered so at the end I ...
5 years, 1 month ago (2015-11-11 20:09:36 UTC) #24
anpol
On 2015/11/11 20:09:36, cpu wrote: > 1- Note that not all icons can / should ...
5 years ago (2015-12-07 14:04:27 UTC) #25
anpol
PTAL
5 years ago (2015-12-16 17:40:05 UTC) #26
grt (UTC plus 2)
lgtm
5 years ago (2015-12-16 18:56:20 UTC) #27
cpu_(ooo_6.6-7.5)
lgtm
5 years ago (2015-12-18 01:17:45 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1406403007/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1406403007/160001
5 years ago (2015-12-18 01:20:28 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/824) android_chromium_gn_compile_dbg on tryserver.chromium.android (JOB_FAILED, ...
5 years ago (2015-12-18 01:25:28 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1406403007/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1406403007/180001
5 years ago (2015-12-18 07:40:38 UTC) #38
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years ago (2015-12-18 08:39:10 UTC) #40
commit-bot: I haz the power
5 years ago (2015-12-18 08:40:11 UTC) #42
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/280746cce16d03242f855c4c795a62b7349f38d4
Cr-Commit-Position: refs/heads/master@{#366055}

Powered by Google App Engine
This is Rietveld 408576698