Commit ad0600f1 authored by Chris Hamilton's avatar Chris Hamilton Committed by Commit Bot

Fix DCHECK in SessionRestoreStatsCollector.

This was found sometime last year, but has recently been tickled with a
higher frequency due to session restore changes.

BUG=784306

Change-Id: I1d200f94f3fdb4e5fb2989f9f0be11a4dec3606a
Reviewed-on: https://chromium-review.googlesource.com/1138867Reviewed-by: default avatarSébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575741}
parent 42734372
......@@ -350,6 +350,12 @@ void SessionRestoreStatsCollector::RemoveTab(NavigationController* tab) {
content::NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_VISUAL_PROPERTIES,
content::NotificationService::AllSources());
}
// Ditto for first load. In this case it no longer needs to be tracked.
if (tabs_tracked_.size() == deferred_tab_count_ &&
!got_first_foreground_load_) {
got_first_foreground_load_ = true;
}
}
SessionRestoreStatsCollector::TabState*
......@@ -445,6 +451,7 @@ void SessionRestoreStatsCollector::ReleaseIfDoneTracking() {
// statistics.
if (!done_tracking_non_deferred_tabs_ && got_first_paint_ &&
waiting_for_load_tab_count_ == 0) {
DCHECK(got_first_foreground_load_);
done_tracking_non_deferred_tabs_ = true;
reporting_delegate_->ReportTabLoaderStats(tab_loader_stats_);
}
......
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