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

Issue 2643853003: ash: fix multiple stack-use-after-scope issues with GetPrimaryDisplay use. (Closed)

Created:
3 years, 11 months ago by krasin1
Modified:
3 years, 11 months ago
Reviewers:
sky
CC:
chromium-reviews, kalyank, sadrul
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ash: fix multiple stack-use-after-scope issues with GetPrimaryDisplay use. The common pattern is to save a reference to the display work area into a local variable, but the reference is to the stack allocated Display object that goes out of scope immediately after taking the reference. The remedy is to have |work_area| as a proper variable. For example: const gfx::Rect& work_area = display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); becomes const gfx::Rect work_area = display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); The bug was found by AddressSanitizer with use-after-free check enabled. It's currently being rolled out into Chrome, and this CL is a part of a larger cleanup of existing failures. BUG=649897 Review-Url: https://codereview.chromium.org/2643853003 Cr-Commit-Position: refs/heads/master@{#444823} Committed: https://chromium.googlesource.com/chromium/src/+/191d9a603c5b154dcf3ba8efeeb632cd80c4e411

Patch Set 1 #

Total comments: 4

Patch Set 2 : sync & address a comment. #

Patch Set 3 : one more test case fixed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -9 lines) Patch
M ash/content/keyboard_overlay/keyboard_overlay_delegate.cc View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M ash/frame/caption_buttons/frame_size_button_unittest.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (8 generated)
krasin1
3 years, 11 months ago (2017-01-18 22:31:53 UTC) #2
sky
https://codereview.chromium.org/2643853003/diff/1/ash/frame/caption_buttons/frame_size_button_unittest.cc File ash/frame/caption_buttons/frame_size_button_unittest.cc (right): https://codereview.chromium.org/2643853003/diff/1/ash/frame/caption_buttons/frame_size_button_unittest.cc#newcode334 ash/frame/caption_buttons/frame_size_button_unittest.cc:334: const gfx::Rect kWorkAreaBoundsInScreen = Generally k is reserved for ...
3 years, 11 months ago (2017-01-18 23:33:46 UTC) #7
krasin1
https://codereview.chromium.org/2643853003/diff/1/ash/frame/caption_buttons/frame_size_button_unittest.cc File ash/frame/caption_buttons/frame_size_button_unittest.cc (right): https://codereview.chromium.org/2643853003/diff/1/ash/frame/caption_buttons/frame_size_button_unittest.cc#newcode334 ash/frame/caption_buttons/frame_size_button_unittest.cc:334: const gfx::Rect kWorkAreaBoundsInScreen = On 2017/01/18 23:33:45, sky wrote: ...
3 years, 11 months ago (2017-01-19 17:36:38 UTC) #8
krasin1
Hi Scott, I have addressed all the comments. Please, take a look!
3 years, 11 months ago (2017-01-19 18:38:10 UTC) #9
sky
Tricky. LGTM
3 years, 11 months ago (2017-01-19 19:15:07 UTC) #10
krasin1
On 2017/01/19 19:15:07, sky wrote: > Tricky. LGTM Indeed. Back in September I spent nearly ...
3 years, 11 months ago (2017-01-19 19:27:10 UTC) #11
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/2643853003/40001
3 years, 11 months ago (2017-01-19 19:27:58 UTC) #13
commit-bot: I haz the power
3 years, 11 months ago (2017-01-19 19:59:09 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/191d9a603c5b154dcf3ba8efeeb6...

Powered by Google App Engine
This is Rietveld 408576698