[soft navs] Total order from SNH to PTMS::DidObserveSoftNavigation [chromium/src : main]

0 views
Skip to first unread message

Johannes Henkel (Gerrit)

unread,
Dec 10, 2025, 5:24:33 PM (6 days ago) Dec 10
to Annie Sullivan, Michal Mocny, Scott Haseley, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
Gerrit-Change-Number: 7247863
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: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Wed, 10 Dec 2025 22:24:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Annie Sullivan (Gerrit)

unread,
Dec 10, 2025, 5:35:06 PM (6 days ago) Dec 10
to Johannes Henkel, Michal Mocny, Scott Haseley, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Johannes Henkel, Michal Mocny and Scott Haseley

Annie Sullivan voted and added 1 comment

Votes added by Annie Sullivan

Code-Review+1

1 comment

File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
Line 133, Patchset 3 (Latest): CHECK_GT(new_metrics.navigation_id, soft_navigation_metrics_->navigation_id);
Annie Sullivan . unresolved

Might be good to have a comment about why we expect the navigation_id to be greater.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
Gerrit-Change-Number: 7247863
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: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Wed, 10 Dec 2025 22:34:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Scott Haseley (Gerrit)

unread,
Dec 10, 2025, 5:40:53 PM (6 days ago) Dec 10
to Johannes Henkel, Annie Sullivan, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Johannes Henkel and Michal Mocny

Scott Haseley added 1 comment

File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
Line 133, Patchset 3 (Latest): CHECK_GT(new_metrics.navigation_id, soft_navigation_metrics_->navigation_id);

Related details

Attention is currently required from:
  • Johannes Henkel
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
Gerrit-Change-Number: 7247863
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: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Wed, 10 Dec 2025 22:40:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Johannes Henkel (Gerrit)

unread,
Dec 10, 2025, 5:57:23 PM (6 days ago) Dec 10
to Annie Sullivan, Michal Mocny, Scott Haseley, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Michal Mocny and Scott Haseley

Johannes Henkel voted and added 3 comments

Votes added by Johannes Henkel

Commit-Queue+1

3 comments

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

PTAL

File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
Line 133, Patchset 3: CHECK_GT(new_metrics.navigation_id, soft_navigation_metrics_->navigation_id);
Scott Haseley . unresolved

I thought this ID can overflow, and that we handle that? Do we not expect that to happen in practice?

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/navigation_id_generator.cc;l=37-42;drc=f4b1a5f91e14941349a0319b35f71d3efb7350af;bpv=1;bpt=1

Johannes Henkel

Yes you're right - good catch!
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/navigation_id_generator.cc;l=37;drc=f4b1a5f91e14941349a0319b35f71d3efb7350af;bpv=1;bpt=1

The overflow is not likely (requires 280M+ soft navs) but maybe it's better to be principled also in case we change the generation at some point.

The count can overflow as well, but I think 4B+ soft navs within a hard nav ought to be enough for anybody. :-)

Line 133, Patchset 3: CHECK_GT(new_metrics.navigation_id, soft_navigation_metrics_->navigation_id);
Annie Sullivan . resolved

Might be good to have a comment about why we expect the navigation_id to be greater.

Johannes Henkel

Good point. Now doing a CHECK_NE here (due to potential overflow), and added comment.

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
Gerrit-Change-Number: 7247863
Gerrit-PatchSet: 4
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-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Wed, 10 Dec 2025 22:57:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
Comment-In-Reply-To: Annie Sullivan <sull...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Scott Haseley (Gerrit)

unread,
Dec 10, 2025, 6:50:14 PM (6 days ago) Dec 10
to Johannes Henkel, Annie Sullivan, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Johannes Henkel and Michal Mocny

Scott Haseley added 2 comments

Patchset-level comments
Scott Haseley . resolved

LG % test issues. I'll stamp after the bots are green.

File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
Line 133, Patchset 3: CHECK_GT(new_metrics.navigation_id, soft_navigation_metrics_->navigation_id);
Scott Haseley . resolved

I thought this ID can overflow, and that we handle that? Do we not expect that to happen in practice?

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/navigation_id_generator.cc;l=37-42;drc=f4b1a5f91e14941349a0319b35f71d3efb7350af;bpv=1;bpt=1

Johannes Henkel

Yes you're right - good catch!
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/navigation_id_generator.cc;l=37;drc=f4b1a5f91e14941349a0319b35f71d3efb7350af;bpv=1;bpt=1

The overflow is not likely (requires 280M+ soft navs) but maybe it's better to be principled also in case we change the generation at some point.

The count can overflow as well, but I think 4B+ soft navs within a hard nav ought to be enough for anybody. :-)

Scott Haseley

Yeah unlikely in practice, but +1 to being consistent with the generator, since otherwise why have that. Checking NE is a nice compromise.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Michal Mocny
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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
    Gerrit-Change-Number: 7247863
    Gerrit-PatchSet: 4
    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-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Wed, 10 Dec 2025 23:50:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Dec 11, 2025, 3:00:58 AM (6 days ago) Dec 11
    to Annie Sullivan, Michal Mocny, Scott Haseley, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Annie Sullivan and Michal Mocny

    Johannes Henkel added 1 comment

    File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
    Line 145, Patchset 7 (Latest): // Now that we've checked the invariants, start with a fresh Mojom
    // message, including a cleared out largest_contentful_paint field.
    soft_navigation_metrics_ = CreateSoftNavigationMetrics();
    Johannes Henkel . unresolved

    I'd like to try to make one more change here, while I'm at this. I'm concerned the previous version doesn't clear out largest_contentful_paint, which means that it could stick around from the previous soft nav. It would then actually get sent, if the delay from EnsureSendTimer is greater than the time it takes to collect the first LCP lcp belonging to this new soft nav.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
    Gerrit-Change-Number: 7247863
    Gerrit-PatchSet: 7
    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-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Dec 2025 08:00:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Dec 15, 2025, 2:35:31 PM (yesterday) Dec 15
    to Johannes Henkel, Annie Sullivan, Scott Haseley, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@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

    Michal Mocny voted and added 2 comments

    Votes added by Michal Mocny

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 9 (Latest):
    Michal Mocny . resolved

    LGTM from my part with a small suggestion.

    (I don't know if other reviewer concerns are fully addressed)

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
    Line 516, Patchset 9 (Latest): .count = ++soft_navigation_count_,
    Michal Mocny . unresolved

    Nit: Wonder if we make it clear that this value is "ForReporting" purposes only, at this point.

    We have an api for "interactionCount" and if we ever wanted an api for "navigationCount" we wouldn't want to use this value as-is any more.

    ---

    Alternatively, we currently report soft-nav to metrics from exactly 1 place: `SoftNavigationHeuristics::EmitSoftNavigationEntry`, which is also where we report to perf timeline.

    So maybe just incrementing the count *there* makes more sense (even though it will be in the same sync task, the order makes more sense to me).

    It also means you can make this function non-const again?

    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 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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
    Gerrit-Change-Number: 7247863
    Gerrit-PatchSet: 9
    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-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Dec 2025 19:35:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 15, 2025, 2:38:36 PM (yesterday) Dec 15
    to Johannes Henkel, Michal Mocny, Annie Sullivan, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@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

    Scott Haseley voted and added 2 comments

    Votes added by Scott Haseley

    Code-Review+1

    2 comments

    Patchset-level comments
    Scott Haseley . resolved

    lgtm also % comments

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics_test.cc
    Line 248, Patchset 9 (Latest): /*info=*/DOMPaintTimingInfo());
    Scott Haseley . unresolved

    nit/optional: would it be difficult to make this have real values? In the future, we might CHECK that these get set together.

    Gerrit-Comment-Date: Mon, 15 Dec 2025 19:38:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Dec 15, 2025, 5:14:11 PM (yesterday) Dec 15
    to Scott Haseley, Michal Mocny, Annie Sullivan, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Annie Sullivan

    Johannes Henkel voted and added 3 comments

    Votes added by Johannes Henkel

    Commit-Queue+2

    3 comments

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

    Thanks a lot.

    Will try to submit./

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
    Line 516, Patchset 9: .count = ++soft_navigation_count_,
    Michal Mocny . resolved

    Nit: Wonder if we make it clear that this value is "ForReporting" purposes only, at this point.

    We have an api for "interactionCount" and if we ever wanted an api for "navigationCount" we wouldn't want to use this value as-is any more.

    ---

    Alternatively, we currently report soft-nav to metrics from exactly 1 place: `SoftNavigationHeuristics::EmitSoftNavigationEntry`, which is also where we report to perf timeline.

    So maybe just incrementing the count *there* makes more sense (even though it will be in the same sync task, the order makes more sense to me).

    It also means you can make this function non-const again?

    Johannes Henkel

    Yes, moved it to EmitSoftNavigationEntry with a comment and made this one const again. I guess we need to be careful to not refactor it out of sync though, that's why I tried putting it here. :-)

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics_test.cc
    Line 248, Patchset 9: /*info=*/DOMPaintTimingInfo());
    Scott Haseley . resolved

    nit/optional: would it be difficult to make this have real values? In the future, we might CHECK that these get set together.

    Johannes Henkel

    Not difficult - I added this just to try it and it continues to pass:

        auto paint_time = base::TimeTicks::Now();
    DOMHighResTimeStamp dom_timestamp =
    DOMWindowPerformance::performance(
    *GetDocument().domWindow())
    ->MonotonicTimeToDOMHighResTimeStamp(paint_time);
    record->SetPaintTime(paint_time,
    /*info=*/DOMPaintTimingInfo({dom_timestamp, dom_timestamp}));

    But I think it's better to do that when adding the CHECK, not before, to see the effect of the increased checks in the same change. So will leave this as is for now.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
    Gerrit-Change-Number: 7247863
    Gerrit-PatchSet: 10
    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-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Dec 2025 22:14:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Dec 15, 2025, 5:19:28 PM (yesterday) Dec 15
    to Scott Haseley, Michal Mocny, Annie Sullivan, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Annie Sullivan

    Johannes Henkel voted and added 1 comment

    Votes added by Johannes Henkel

    Commit-Queue+2

    1 comment

    File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
    Line 145, Patchset 7: // Now that we've checked the invariants, start with a fresh Mojom

    // message, including a cleared out largest_contentful_paint field.
    soft_navigation_metrics_ = CreateSoftNavigationMetrics();
    Johannes Henkel . resolved

    I'd like to try to make one more change here, while I'm at this. I'm concerned the previous version doesn't clear out largest_contentful_paint, which means that it could stick around from the previous soft nav. It would then actually get sent, if the delay from EnsureSendTimer is greater than the time it takes to collect the first LCP lcp belonging to this new soft nav.

    Johannes Henkel

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
      Gerrit-Change-Number: 7247863
      Gerrit-PatchSet: 11
      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-Attention: Annie Sullivan <sull...@chromium.org>
      Gerrit-Comment-Date: Mon, 15 Dec 2025 22:19:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Dec 15, 2025, 6:31:37 PM (yesterday) Dec 15
      to Johannes Henkel, Scott Haseley, Michal Mocny, Annie Sullivan, chromium...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, core-timi...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      9 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
      Insertions: 1, Deletions: 1.

      @@ -143,7 +143,7 @@
      base::FunctionRef<void(InteractionEffectsMonitor&)>);

      private:
      - void ReportSoftNavigationToMetrics(SoftNavigationContext*);
      + void ReportSoftNavigationToMetrics(SoftNavigationContext*) const;
      void SetIsTrackingSoftNavigationHeuristicsOnDocument(bool value) const;

      // We can grab a context from the "running task", or sometimes from other
      ```
      ```
      The name of the file: third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
      Insertions: 6, Deletions: 2.

      @@ -407,6 +407,10 @@
      CHECK(context->HasFirstContentfulPaint());
      CHECK(!context->WasEmitted());
      context->MarkEmitted();
      + // Since this is used for metrics reporting and sent as part of the
      + // SoftNavigationMetrics record, we must increment it before calling
      + // ReportSoftNavigationToMetrics.
      + soft_navigation_count_++;

      WindowPerformance* performance = DOMWindowPerformance::performance(*window_);
      CHECK(performance);
      @@ -501,7 +505,7 @@
      }

      void SoftNavigationHeuristics::ReportSoftNavigationToMetrics(
      - SoftNavigationContext* context) {
      + SoftNavigationContext* context) const {
      LocalFrame* frame = window_->GetFrame();
      // We should not be running paint timing callbacks for detached frames.
      CHECK(frame);
      @@ -513,7 +517,7 @@

      if (LocalFrameClient* frame_client = frame->Client()) {
      blink::SoftNavigationMetricsForReporting metrics = {
      - .count = ++soft_navigation_count_,
      + .count = soft_navigation_count_,
      .start_time = loader->GetTiming().MonotonicTimeToPseudoWallTime(
      context->TimeOrigin()),
      .first_contentful_paint =
      ```

      Change information

      Commit message:
      [soft navs] Total order from SNH to PTMS::DidObserveSoftNavigation

      Objective is to enforce with CHECKs that:
      * The count of soft navigations increases strictly monotonically
      * We never send a count of 0
      * navigation_id changes for each soft nav, we never send
      an absent navigation_id
      * There's always a same_document_metrics_token, and it changes
      with each update.

      The main logic change is to pre-increment SNH::soft_navigation_count_
      exactly when we decide to send the soft nav to the browser. There is also a small change in page_timing_metrics_sender to reset the soft_navigation_metrics_ to an empty record to avoid picking up a previous soft LCP.
      Bug: 467739556
      Change-Id: I9721a3bd0dfc52e5172df73f4927aed830a51da5
      Reviewed-by: Scott Haseley <shas...@chromium.org>
      Commit-Queue: Johannes Henkel <joha...@chromium.org>
      Reviewed-by: Michal Mocny <mmo...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1559036}
      Files:
      • M components/page_load_metrics/renderer/page_timing_metrics_sender.cc
      • M third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
      • M third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
      • M third_party/blink/renderer/core/timing/soft_navigation_heuristics_test.cc
      Change size: S
      Delta: 4 files changed, 31 insertions(+), 11 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Michal Mocny, +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: I9721a3bd0dfc52e5172df73f4927aed830a51da5
      Gerrit-Change-Number: 7247863
      Gerrit-PatchSet: 12
      Gerrit-Owner: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Annie Sullivan <sull...@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: Scott Haseley <shas...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages