removed: onVisitComplete
added: surfaceId
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/69824f1f754963700f7b97e6be05a8a9f58a4eb0
commit 69824f1f754963700f7b97e6be05a8a9f58a4eb0
Author: Xi Han <hanxi@google.com>
Date: Fri Apr 3 05:15:55 2026 -0700
[Memory] Refactor NavigationRecorder.
In this CL, we fix the issue that FeedStream can't be released from
memory after NTP navigates. This is due to a NavigationRecorder being
created when a NTP navigates, and it has a callback which keeps a
reference FeedSurfaceRendererBridge to log the duration of users
reading a card. The callback won't be called until a new Tab is
created, i.e. leaving the current Tab, and #onHidden() is called.
This leads to the FeedStream remain in memory after feeds is closed.
In this CL, we add NavigationRecorder in C++ which calls the FeedApi
directly to log the metrics. It no longer has a reference to the
FeedSurfaceRendererBridge, and FeedStream can be released after the
NTP navigates. FeedStream's memory foot print is cleaned up after
leaving NTPs: http://shortn/_3DjIXJjzfY.
This CL also fixes a visiting time logging issue. If the Tab never
becomes foreground (mStartTimeMs == 0), we will log 0 for visit
duration.
Bug: 487641528, 493844946
Change-Id: I34af7d2308d6ed070dff8ac52d11f17ae0977449
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7728181
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Dan Harrington <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1609755}