Consider transient entry in entry count DCHECK
NavigationControllerImpl::SetTransientEntry adds an entry regardless of the current number of entries, disregarding max_entry_count(). This is fine, as the entry will not be committed. In fact, any subsequent navigation will remove it. However, if you call GetEntryCount() at that point, the DCHECK for the entry count may fail, as it does not consider a transient entry an exception. There is no need for this. This change modifies the upper bound in the said DCHECK to depend on whether or not a transient entry is present and adds a test verifying that adding a transient entry when navigation history is full works correctly. Note that adding a transient entry is not a good time to prune the oldest entry instead, as pending entry may be present. Pruning is not safe at this point. Bug: 979536 Change-Id: Ic30e3aa73e72c87a80656c6872209935159b31ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1681583Reviewed-by:Charlie Reis <creis@chromium.org> Commit-Queue: Nasko Oskov <nasko@chromium.org> Cr-Commit-Position: refs/heads/master@{#675608}
Showing
Please register or sign in to comment