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

Issue 2833403002: [Notifications] Fix crash in AddNotification. (Closed)

Created:
3 years, 8 months ago by Eliot Courtney
Modified:
3 years, 8 months ago
Reviewers:
xiyuan, yoshiki, yhanada
CC:
chromium-reviews, Peter Beverloo, mlamouri+watch-notifications_chromium.org, awdf+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Notifications] Fix crash in AddNotification. Calling ResetRepositionSession during UpdateNotificationSize can end up deleting notification items. This caused two crashes. One in AddNotification, which calls onItemUpdated, which, without this change, can set item_ to null. The other is a crash in ShouldUpdateControlButtonsColor which does not check if item_ is null since it is called from a context where item_ should not be null. BUG=714493 BUG=714032 Review-Url: https://codereview.chromium.org/2833403002 Cr-Commit-Position: refs/heads/master@{#466914} Committed: https://chromium.googlesource.com/chromium/src/+/d331195379094f2cf000746e21ad047d5e1fb6d0

Patch Set 1 #

Patch Set 2 : Add check back. #

Total comments: 6

Patch Set 3 : Add TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -25 lines) Patch
M ui/message_center/views/message_center_view.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/message_center/views/message_center_view.cc View 1 2 4 chunks +45 lines, -25 lines 0 comments Download

Messages

Total messages: 20 (11 generated)
Eliot Courtney
This changes the order of setting the reposition session and looking up in notification_views_ whether ...
3 years, 8 months ago (2017-04-24 11:34:38 UTC) #2
xiyuan
lgtm
3 years, 8 months ago (2017-04-24 16:30:10 UTC) #3
yhanada
lgtm
3 years, 8 months ago (2017-04-25 04:35:07 UTC) #8
yoshiki
lgtm https://codereview.chromium.org/2833403002/diff/20001/ui/message_center/views/message_center_view.cc File ui/message_center/views/message_center_view.cc (right): https://codereview.chromium.org/2833403002/diff/20001/ui/message_center/views/message_center_view.cc#newcode411 ui/message_center/views/message_center_view.cc:411: // checks it anyway. How about adding NOTREACHED() ...
3 years, 8 months ago (2017-04-25 04:58:01 UTC) #9
Eliot Courtney
https://codereview.chromium.org/2833403002/diff/20001/ui/message_center/views/message_center_view.cc File ui/message_center/views/message_center_view.cc (right): https://codereview.chromium.org/2833403002/diff/20001/ui/message_center/views/message_center_view.cc#newcode411 ui/message_center/views/message_center_view.cc:411: // checks it anyway. On 2017/04/25 04:58:00, yoshiki wrote: ...
3 years, 8 months ago (2017-04-25 05:06:52 UTC) #12
yoshiki
btw, could you add a test for this change? If it's urgent, doing in separated ...
3 years, 8 months ago (2017-04-25 06:03:11 UTC) #13
Eliot Courtney
Sure, I will add a test in a separate CL. Thanks for the reviews~! https://codereview.chromium.org/2833403002/diff/20001/ui/message_center/views/message_center_view.cc ...
3 years, 8 months ago (2017-04-25 06:29:12 UTC) #14
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/2833403002/40001
3 years, 8 months ago (2017-04-25 06:30:14 UTC) #17
commit-bot: I haz the power
3 years, 8 months ago (2017-04-25 07:21:05 UTC) #20
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/d331195379094f2cf000746e21ad...

Powered by Google App Engine
This is Rietveld 408576698