[soft navs] Add HistoryNavigation.SoftNavigationCount [chromium/src : main]

0 views
Skip to first unread message

Johannes Henkel (Gerrit)

unread,
Apr 1, 2026, 8:31:38 PM (2 days ago) Apr 1
to Michal Mocny, Annie Sullivan, Scott Haseley, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Annie Sullivan, Michal Mocny and Scott Haseley

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Annie Sullivan
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
Gerrit-Change-Number: 7722543
Gerrit-PatchSet: 1
Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 00:31:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Apr 2, 2026, 11:12:47 AM (yesterday) Apr 2
to Johannes Henkel, Robert Kaplow, Annie Sullivan, Scott Haseley, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Annie Sullivan, Johannes Henkel, Robert Kaplow and Scott Haseley

Michal Mocny voted and added 3 comments

Votes added by Michal Mocny

Code-Review+1

3 comments

File chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
Line 1039, Patchset 1 (Latest):class SoftNavigationBackForwardCacheTest : public MetricIntegrationTest {
Michal Mocny . resolved

This is fine, but I think we discussed in a previous patch that if you extend `SoftNavigationTest` then you can share some base members and some shared SetUp, instead of using free functions and passing state around.

I'll leave resolved because this is just style.

File components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc
Line 274, Patchset 1 (Latest): soft_navigation_count_++;
Michal Mocny . unresolved

This is totally fine and matches existing implementation-- but some quick thoughts on the long term design:

  • It seems to me like there some existing duplication amongst pageload observer types, but not everything is duplicated...
  • We already have a common base class `PageLoadMetricsObserver`, (though it seems not to have much in the way of implementation defaults), and it has a default Delegate, which is typically `PageLoadTracker`, I think
  • We also already have a common `OnComplete(timing)` which specific PLM observers override, and which acts as the gateway between fetching common metrics from the Delegate, and Recording specific metrics to UKM which differ per PLM observer type.

So the pattern is, I think:

  • Common metrics are in PageLoadTracker
  • Specific reporting is totally customized
  • Timings for recording have defaults, but can be overridden

---

I think you are planning to add Soft-nav specific metrics to `PageLoadTracker`? But I wonder if the page-global soft-nav metrics (soft-nav-count, *-before-first-soft-nav, etc) should all go there as well?

You may already have presented that design, I'm just trying to catch up!

File tools/metrics/ukm/ukm.xml
Line 10678, Patchset 1 (Latest): https://bit.ly/soft-navigation
Michal Mocny . unresolved

1. bit.ly links are basically an ad-serving system now, so we should update these.
2. The doc links to an old soft-navs design doc, I would link to either the WICG repo (https://github.com/WICG/soft-navigations) or the spec (https://wicg.github.io/soft-navigations/) -- Note: they both link to each other already.

Could you also update the existing xml docs/links?

Open in Gerrit

Related details

Attention is currently required from:
  • Annie Sullivan
  • Johannes Henkel
  • Robert Kaplow
  • Scott Haseley
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
    Gerrit-Change-Number: 7722543
    Gerrit-PatchSet: 1
    Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 15:12:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Apr 2, 2026, 12:37:41 PM (yesterday) Apr 2
    to Michal Mocny, Robert Kaplow, Annie Sullivan, Scott Haseley, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Annie Sullivan, Robert Kaplow and Scott Haseley

    Johannes Henkel added 3 comments

    Patchset-level comments
    File-level comment, Patchset 2 (Latest):
    Johannes Henkel . resolved

    Thanks a lot!

    File components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc
    Line 274, Patchset 1: soft_navigation_count_++;
    Michal Mocny . resolved

    This is totally fine and matches existing implementation-- but some quick thoughts on the long term design:

    • It seems to me like there some existing duplication amongst pageload observer types, but not everything is duplicated...
    • We already have a common base class `PageLoadMetricsObserver`, (though it seems not to have much in the way of implementation defaults), and it has a default Delegate, which is typically `PageLoadTracker`, I think
    • We also already have a common `OnComplete(timing)` which specific PLM observers override, and which acts as the gateway between fetching common metrics from the Delegate, and Recording specific metrics to UKM which differ per PLM observer type.

    So the pattern is, I think:

    • Common metrics are in PageLoadTracker
    • Specific reporting is totally customized
    • Timings for recording have defaults, but can be overridden

    ---

    I think you are planning to add Soft-nav specific metrics to `PageLoadTracker`? But I wonder if the page-global soft-nav metrics (soft-nav-count, *-before-first-soft-nav, etc) should all go there as well?

    You may already have presented that design, I'm just trying to catch up!

    Johannes Henkel

    Yeah, thank you! So for now, what I'm trying to get done is the counts, and I figured what I have here is the simplest way to accomplish it.

    For the other metrics, my current thinking / rough plan is that I'll try to carve out a class from the ukm_page_load_metrics_observer.cc (the logic about always logging the "previous" soft nav event), and then see how to use that in the prerender and bfcache observers.

    I've also been reading the page load tracker and the metrics dispatcher, and will see how / if adding to these is needed. Mostly I'm worried about the mixing of delayed dispatch (e.g. timings that are waiting for other frames) with more synchronous dispatch like the OnSoftNavigation hook that I'm using here. But for the count, I think it's correct-ish.

    File tools/metrics/ukm/ukm.xml

    1. bit.ly links are basically an ad-serving system now, so we should update these.
    2. The doc links to an old soft-navs design doc, I would link to either the WICG repo (https://github.com/WICG/soft-navigations) or the spec (https://wicg.github.io/soft-navigations/) -- Note: they both link to each other already.

    Could you also update the existing xml docs/links?

    Johannes Henkel

    Yup, I found three instances of this one.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Robert Kaplow
    • Scott Haseley
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
      Gerrit-Change-Number: 7722543
      Gerrit-PatchSet: 2
      Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
      Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 16:37:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Scott Haseley (Gerrit)

      unread,
      Apr 2, 2026, 12:54:08 PM (yesterday) Apr 2
      to Johannes Henkel, Michal Mocny, Robert Kaplow, Annie Sullivan, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Annie Sullivan and Robert Kaplow

      Scott Haseley voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Annie Sullivan
      • Robert Kaplow
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
      Gerrit-Change-Number: 7722543
      Gerrit-PatchSet: 2
      Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
      Gerrit-Attention: Robert Kaplow <rka...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 16:54:00 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Robert Kaplow (Gerrit)

      unread,
      Apr 2, 2026, 9:26:54 PM (24 hours ago) Apr 2
      to Johannes Henkel, Scott Haseley, Michal Mocny, Annie Sullivan, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Annie Sullivan and Johannes Henkel

      Robert Kaplow voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Annie Sullivan
      • Johannes Henkel
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
      Gerrit-Change-Number: 7722543
      Gerrit-PatchSet: 3
      Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 01:26:44 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Johannes Henkel (Gerrit)

      unread,
      Apr 2, 2026, 10:09:24 PM (23 hours ago) Apr 2
      to Annie Sullivan, Robert Kaplow, Scott Haseley, Michal Mocny, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org

      Johannes Henkel voted and added 1 comment

      Votes added by Johannes Henkel

      Commit-Queue+2

      1 comment

      Patchset-level comments
      Johannes Henkel . resolved

      Thanks a lot!

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
      Gerrit-Change-Number: 7722543
      Gerrit-PatchSet: 3
      Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-CC: Annie Sullivan <sull...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 02:09:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 2, 2026, 10:57:44 PM (22 hours ago) Apr 2
      to Johannes Henkel, Annie Sullivan, Robert Kaplow, Scott Haseley, Michal Mocny, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      [soft navs] Add HistoryNavigation.SoftNavigationCount

      This metric works just like Pageload.SoftNavigationcount and
      PrerenderPageLoad.SoftNavigationCount.

      Privacy doc:
      https://docs.google.com/document/d/1ZhUkF63xINZDVQ3e5Bg370TpOKGf6_-_AuznrzB2tEk/edit?resourcekey=0-dtxS11-tTye7_GjEzMHuyw
      Bug: 496664486
      Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
      Reviewed-by: Michal Mocny <mmo...@chromium.org>
      Reviewed-by: Scott Haseley <shas...@chromium.org>
      Reviewed-by: Robert Kaplow <rka...@chromium.org>
      Commit-Queue: Johannes Henkel <joha...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1609633}
      Files:
      • M chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
      • M components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.cc
      • M components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h
      • M tools/metrics/ukm/ukm.xml
      Change size: M
      Delta: 4 files changed, 169 insertions(+), 2 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Michal Mocny, +1 by Robert Kaplow, +1 by Scott Haseley
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I175c65cfc4e296ad966dd3756f5820e693d0e4c4
      Gerrit-Change-Number: 7722543
      Gerrit-PatchSet: 4
      Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Robert Kaplow <rka...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-CC: Annie Sullivan <sull...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages