Skip to content

Commit

Permalink
Cleanup kUpdateSessionHistoryIndexBeforeNavigationStateChanged flag.
Browse files Browse the repository at this point in the history
This rolled out successfully in r1139859 (M115) and the kill switch is
no longer needed.

Bug: 1439948
Change-Id: If893bcb300585235104f481f653060082b5c83c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4906760
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1204666}
  • Loading branch information
creis authored and Chromium LUCI CQ committed Oct 3, 2023
1 parent 0009a5b commit fbe5f10
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions content/browser/renderer_host/navigation_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@
namespace content {
namespace {

// TODO(https://crbug.com/1439948): Remove this base::Feature kill switch once
// the feature safely rolls out.
BASE_FEATURE(kUpdateSessionHistoryIndexBeforeNavigationStateChanged,
"UpdateSessionHistoryIndexBeforeNavigationStateChanged",
base::FEATURE_ENABLED_BY_DEFAULT);

// Invoked when entries have been pruned, or removed. For example, if the
// current entries are [google, digg, yahoo], with the current entry google,
// and the user types in cnet, then digg and yahoo are pruned.
Expand Down Expand Up @@ -2218,10 +2212,7 @@ void NavigationControllerImpl::RendererDidNavigateToExistingEntry(
// delegate sees the correct committed index when notified of navigation
// state changes. (Otherwise CanGoBack may incorrectly return true, as in
// https://crbug.com/1439948.)
if (base::FeatureList::IsEnabled(
kUpdateSessionHistoryIndexBeforeNavigationStateChanged)) {
last_committed_entry_index_ = GetIndexOfEntry(entry);
}
last_committed_entry_index_ = GetIndexOfEntry(entry);

// We should also usually discard the pending entry if it corresponds to a
// different navigation, since that one is now likely canceled. In rare
Expand All @@ -2233,13 +2224,6 @@ void NavigationControllerImpl::RendererDidNavigateToExistingEntry(
// actually change any other state, just kill the pointer.
if (!keep_pending_entry)
DiscardNonCommittedEntriesWithCommitDetails(commit_details);

if (!base::FeatureList::IsEnabled(
kUpdateSessionHistoryIndexBeforeNavigationStateChanged)) {
// Update the last committed index to reflect the committed entry.
// (This is legacy behavior, in case the kill-switch needs to be used.)
last_committed_entry_index_ = GetIndexOfEntry(entry);
}
}

void NavigationControllerImpl::RendererDidNavigateNewSubframe(
Expand Down

0 comments on commit fbe5f10

Please sign in to comment.