Commit 17c00bdf authored by xiyuan's avatar xiyuan Committed by Commit bot

arc: Fix UpdatePinnedState crash

Transient notifications get into a situation that the item is destroyed
via mojo before its surface gets mapped via wayland. Check |item_|
before UpdatePinnedState() call in SetSurface to fix the crash.

BUG=647829
TBR=yoshiki@chromium.org

Review-Url: https://codereview.chromium.org/2345373002
Cr-Commit-Position: refs/heads/master@{#419508}
parent ddfbe690
......@@ -230,7 +230,8 @@ void ArcCustomNotificationView::SetSurface(exo::NotificationSurface* surface) {
if (GetWidget())
AttachSurface();
UpdatePinnedState();
if (item_)
UpdatePinnedState();
}
}
......@@ -268,6 +269,8 @@ void ArcCustomNotificationView::UpdateCloseButtonVisiblity() {
}
void ArcCustomNotificationView::UpdatePinnedState() {
DCHECK(item_);
if (item_->pinned() && floating_close_button_widget_) {
floating_close_button_widget_.reset();
} else if (!item_->pinned() && !floating_close_button_widget_) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment