[ios] TabUsageRecorder should use virtual URL to decided when to record.
TabUsageRecorder::ShouldIgnoreWebState() is meant to filter out tabs that are currently loading a chrome:// URL and not record page load stats for them. However, it treats pending item and last committed item inconsistently and looks at the URL for one and virtual URL for the other. This causes a problem when switching to WKBasedNavigationManager because switching to an evicted tab will load restore_session.html in the web state. This results in a pending item with a file:/// URL and a virtual URL that is whatever the page that is being restored, which may be a chrome:// URL. Not using virtual URL for pending item seems to be a bug introduced in https://codereview.chromium.org/2820763002. It replaces [tab url] with pending_item->GetURL. At the time, [tab url] was implemented using virtual URL (see https://codereview.chromium.org/2919983002). Added a unit test to cover this case. Bug: 789993 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I0861ee94ca0d3c5612d3e1ad7680f18bfd7368f0 Reviewed-on: https://chromium-review.googlesource.com/817356Reviewed-by:Sylvain Defresne <sdefresne@chromium.org> Reviewed-by:
Peter Lee <pkl@chromium.org> Reviewed-by:
Eugene But <eugenebut@chromium.org> Commit-Queue: Danyao Wang <danyao@chromium.org> Cr-Commit-Position: refs/heads/master@{#523813}
Showing
Please register or sign in to comment