Commit 1d4652ed authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] Add CHECKs to try to debug the GetMatchIcon crashes

This crash has been ongoing for a few years. The stack traces don't
lead to any obvious clues, and neither do the minidumps in Visual
Studio, since the most valuable local variable names have been
optimized away.

This CL adds two CHECKs and breaks apart two lines to try to get a
better clue as to why this crash is happening.

The crash seems to suggest we are using a dangling pointer.

Bug: 1024114
Change-Id: I085056561e776097120aab2ae075c32db49fcab7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439485Reviewed-by: default avatarOrin Jaworski <orinj@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812210}
parent 33dc8940
......@@ -329,10 +329,14 @@ const gfx::VectorIcon& AutocompleteMatch::GetVectorIcon(
return (pedal ? pedal->GetVectorIcon() : omnibox::kPedalIcon);
case Type::NUM_TYPES:
NOTREACHED();
static const gfx::VectorIcon dummy = {};
return dummy;
// TODO(https://crbug.com/1024114): Replace with NOTREACHED() once fixed.
CHECK(false);
return vector_icons::kErrorIcon;
}
// TODO(https://crbug.com/1024114): Replace with NOTREACHED() once fixed.
CHECK(false);
return vector_icons::kErrorIcon;
}
#endif
......
......@@ -326,7 +326,10 @@ gfx::Image OmniboxPopupModel::GetMatchIcon(const AutocompleteMatch& match,
return edit_model_->client()->GetSizedIcon(favicon);
}
const auto& vector_icon_type = match.GetVectorIcon(IsStarredMatch(match));
// The below lines are deliberately separate to try to debug
// https://crbug.com/1024114.
bool is_starred_match = IsStarredMatch(match);
const auto& vector_icon_type = match.GetVectorIcon(is_starred_match);
return edit_model_->client()->GetSizedIcon(vector_icon_type,
vector_icon_color);
......
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