TabRanker: Fix Query time logging.


TabRanker query time logging was landed in this cl:
https://chromium-review.googlesource.com/c/chromium/src/+/1350445

TabManager::GetSortedLifecycleUnitsFromTabRanker() was created to bypass calls to
TabManager::GetSortedLifecycleUnits()

But this was wrong on two aspects:

(1) TabManagerDelegate::LowMemoryKillImpl is still calling GetSortedLifecycleUnits(),
    so ChromeOS discards are all skipped.

(2) TabManagerDelegate::Candidate is calling
    lifecycle_unit_->GetSortKey() for inferring sorting,
    Which means TabRanker model won't work for ChromeOS discards.


The fix:
(1) Change TabManager, TabLifecycleUnit back to their previous code,
    which were sorting LifecycleUnits by TabRanker when it's enabled.

(2) Add TabActivityWatcher::LogOldestNTabFeatures() and call this function in
    TabManager::DiscardTab for query time logging.

Bug: 911474

Change-Id: I103e8237cd96ea87667536b7b44b27fe8772abb4
Reviewed-on: https://chromium-review.googlesource.com/c/1360471
Reviewed-by: Christopher Morin <cmtm@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Charles . <charleszhao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614623}
6 files changed