Commit 81a2702f authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

speculative fix for status-bubble crash

Crash data seems to indicate after the call to SetBubbleWidth(). AFAICT
the functions that are called after SetBubbleWidth() can be moved *before*
the call to SetBubbleWidth(), so moving them in hopes of fixing the crash.

BUG=943564
TEST=none

Change-Id: I271fdc0e90a89f8d3ce4f45a848e4dcbeee0c1dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1540308Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644903}
parent b6a30f8b
...@@ -588,6 +588,8 @@ class StatusBubbleViews::StatusViewExpander : public gfx::LinearAnimation, ...@@ -588,6 +588,8 @@ class StatusBubbleViews::StatusViewExpander : public gfx::LinearAnimation,
// Widths at expansion start and end. // Widths at expansion start and end.
int expansion_start_ = 0; int expansion_start_ = 0;
int expansion_end_ = 0; int expansion_end_ = 0;
DISALLOW_COPY_AND_ASSIGN(StatusViewExpander);
}; };
void StatusBubbleViews::StatusViewExpander::AnimateToState(double state) { void StatusBubbleViews::StatusViewExpander::AnimateToState(double state) {
...@@ -596,8 +598,10 @@ void StatusBubbleViews::StatusViewExpander::AnimateToState(double state) { ...@@ -596,8 +598,10 @@ void StatusBubbleViews::StatusViewExpander::AnimateToState(double state) {
void StatusBubbleViews::StatusViewExpander::AnimationEnded( void StatusBubbleViews::StatusViewExpander::AnimationEnded(
const gfx::Animation* animation) { const gfx::Animation* animation) {
SetBubbleWidth(expansion_end_);
status_view_->SetText(expanded_text_, false); status_view_->SetText(expanded_text_, false);
SetBubbleWidth(expansion_end_);
// WARNING: crash data seems to indicate |this| may be deleted by the time
// SetBubbleWidth() returns.
} }
void StatusBubbleViews::StatusViewExpander::StartExpansion( void StatusBubbleViews::StatusViewExpander::StartExpansion(
...@@ -621,8 +625,10 @@ int StatusBubbleViews::StatusViewExpander::GetCurrentBubbleWidth() { ...@@ -621,8 +625,10 @@ int StatusBubbleViews::StatusViewExpander::GetCurrentBubbleWidth() {
} }
void StatusBubbleViews::StatusViewExpander::SetBubbleWidth(int width) { void StatusBubbleViews::StatusViewExpander::SetBubbleWidth(int width) {
status_bubble_->SetBubbleWidth(width);
status_view_->SchedulePaint(); status_view_->SchedulePaint();
status_bubble_->SetBubbleWidth(width);
// WARNING: crash data seems to indicate |this| may be deleted by the time
// SetBubbleWidth() returns.
} }
......
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