Commit 0ca3e6d8 authored by jaekyun's avatar jaekyun Committed by Commit bot

Update visible ids if any of their thumbnails are invalid

For now, ThumbnailStore::UpdateVisibleIds only compares tab id lists to
determin whether updating visible ids is needed or not.

But we need to update them if any of their thumbnails are invalid.

BUG=468242

Review URL: https://codereview.chromium.org/1005343004

Cr-Commit-Position: refs/heads/master@{#321305}
parent 9e077bba
......@@ -269,20 +269,20 @@ void ThumbnailStore::UpdateVisibleIds(const TabIdList& priority) {
if (visible_ids_.size() == ids_size) {
// Early out if called with the same input as last time (We only care
// about the first mCache.MaximumCacheSize() entries).
bool lists_differ = false;
bool needs_update = false;
TabIdList::const_iterator visible_iter = visible_ids_.begin();
TabIdList::const_iterator priority_iter = priority.begin();
while (visible_iter != visible_ids_.end() &&
priority_iter != priority.end()) {
if (*priority_iter != *visible_iter) {
lists_differ = true;
if (*priority_iter != *visible_iter || !cache_.Get(*priority_iter)) {
needs_update = true;
break;
}
visible_iter++;
priority_iter++;
}
if (!lists_differ)
if (!needs_update)
return;
}
......
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