Commit e292898e authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

omnibox: fix possible crash

This is a regression from:
https://chromium-review.googlesource.com/c/chromium/src/+/2483342

The case under which the crash happens is when the internal cache
(URLIndexPrivateData) is being rebuilt on the history thread and
GetMostRecentVisitsForURL() returns false. I believe that basically
only happens if there is a problem with the db.

I would have liked a test for this, but there is no way to
force the db to return false.

BUG=1146970
TEST=none

Change-Id: Ied6a7e1c75ef8fcc47043d231f4877a597757bf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527006Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825464}
parent 2bc53605
......@@ -937,9 +937,8 @@ bool URLIndexPrivateData::IndexRow(
// as appropriate.
if (got_visits) {
UpdateRecentVisits(row_id, recent_visits);
} else {
} else if (history_service) {
DCHECK(tracker);
DCHECK(history_service);
ScheduleUpdateRecentVisits(history_service, row_id, tracker);
}
......
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