Commit d0f69d4b authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

[Nav Experiment] Do not notify OnPageLoaded for restore_session.html.

When switching to an evicted tab, WKBasedNavigationManager loads
restore_session.html to restore back/forward history. This load should
not be counted as a new page load by TabUsageRecorder.

This fixes TabUsageRecorderTestCase/testEvictedTabReloadBackground.

Bug: 807428
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: If194acd0de633bc170f221d8a960514995425bce
Reviewed-on: https://chromium-review.googlesource.com/917524Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536743}
parent 90d35140
...@@ -2051,9 +2051,11 @@ registerLoadRequestForURL:(const GURL&)requestURL ...@@ -2051,9 +2051,11 @@ registerLoadRequestForURL:(const GURL&)requestURL
} }
[self restoreStateFromHistory]; [self restoreStateFromHistory];
// Placeholder navigation is implementation details so should not notify // Placeholder and restore session URLs are implementation details so should
// WebStateObservers. // not notify WebStateObservers.
if (!context || !IsPlaceholderUrl(context->GetUrl())) { bool isInternalURL = context && (IsPlaceholderUrl(context->GetUrl()) ||
web::IsRestoreSessionUrl(context->GetUrl()));
if (!isInternalURL) {
_webStateImpl->SetIsLoading(false); _webStateImpl->SetIsLoading(false);
_webStateImpl->OnPageLoaded(currentURL, loadSuccess); _webStateImpl->OnPageLoaded(currentURL, loadSuccess);
} }
......
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