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

Unified Diff: ui/message_center/views/toast_contents_view.cc

Issue 14820016: Changes the order of widget Close() and DecrementDeferCounter(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/toast_contents_view.cc
diff --git a/ui/message_center/views/toast_contents_view.cc b/ui/message_center/views/toast_contents_view.cc
index d5fdbb952dfbda06253e21a74079e1a6d996e426..bd2fd6d89049641683623e884f7c427f39d87569 100644
--- a/ui/message_center/views/toast_contents_view.cc
+++ b/ui/message_center/views/toast_contents_view.cc
@@ -214,11 +214,15 @@ void ToastContentsView::StartFadeIn() {
void ToastContentsView::OnBoundsAnimationEndedOrCancelled(
const ui::Animation* animation) {
- if (collection_)
- collection_->DecrementDeferCounter();
-
if (is_closing_ && closing_animation_ == animation && GetWidget())
GetWidget()->Close();
+
+ // This cannot be called before GetWidget()->Close(). Decrementing defer count
+ // will invoke update, which may invoke another close animation with
+ // incrementing defer counter. Close() after such process will cause a
+ // mismatch between increment/decrement. See crbug.com/238477
+ if (collection_)
+ collection_->DecrementDeferCounter();
}
// ui::AnimationDelegate
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698