Commit 49324606 authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Revert "[multi-profile]Speculative fix for crash while loading AppList search"

This reverts commit 9cf67d23.

Reason for revert: Causes a compile failure on linux-chromeos-google-rel

BUG=995590

Original change's description:
> [multi-profile]Speculative fix for crash while loading AppList search
> 
> Either we are attempting to emplace() past the last element of the
> vector, or the index is negative somehow. Fix the first condition and
> check for the second.
> 
> Bug: 992344
> Change-Id: Id3f6a71a9d5ab3ad41079f9ed1fa7067238faae8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761295
> Commit-Queue: Alex Newcomer <newcomer@chromium.org>
> Reviewed-by: Matthew Mourgos <mmourgos@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#688279}

TBR=newcomer@chromium.org,mmourgos@chromium.org

Change-Id: I245a4b3c01aa86f5ba7178340647963b94a291f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992344
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761345Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688323}
parent ed833fc1
...@@ -300,12 +300,9 @@ std::vector<SearchResult*> SearchResultTileItemListView::GetDisplayResults() { ...@@ -300,12 +300,9 @@ std::vector<SearchResult*> SearchResultTileItemListView::GetDisplayResults() {
return r1->display_index() < r2->display_index(); return r1->display_index() < r2->display_index();
}); });
for (auto* result : policy_tiles_results) { for (auto* result : policy_tiles_results) {
if (result->display_index() >= display_results.size() - 1) { if (result->display_index() > display_results.size() - 1) {
display_results.emplace_back(result); display_results.emplace_back(result);
} else { } else {
// TODO(newcomer): Remove this check once we determine the root cause for
// https://crbug.com/992344.
CHECK_GT(result->display_index(), -1);
display_results.emplace(display_results.begin() + result->display_index(), display_results.emplace(display_results.begin() + result->display_index(),
result); result);
} }
......
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