[soft navs] Add MergeAndClear to INP normalization abstraction in browser [chromium/src : main]

0 views
Skip to first unread message

Johannes Henkel (Gerrit)

unread,
1:12 PM (11 hours ago) 1:12 PM
to Michal Mocny, Annie Sullivan, Chromium LUCI CQ, chromium...@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 Michal Mocny

New activity on the change

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 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: I163d1b07338edad0547cf3e9e546360757f96547
Gerrit-Change-Number: 7532264
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-Attention: Annie Sullivan <sull...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Fri, 30 Jan 2026 18:12:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Annie Sullivan (Gerrit)

unread,
1:17 PM (10 hours ago) 1:17 PM
to Johannes Henkel, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@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

Annie Sullivan voted and added 1 comment

Votes added by Annie Sullivan

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Annie Sullivan . resolved

This looks good to me but I'd like Michal to take a look too

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: I163d1b07338edad0547cf3e9e546360757f96547
Gerrit-Change-Number: 7532264
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-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Fri, 30 Jan 2026 18:16:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
1:32 PM (10 hours ago) 1:32 PM
to Johannes Henkel, Annie Sullivan, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Johannes Henkel

Michal Mocny added 2 comments

File components/page_load_metrics/browser/responsiveness_metrics_normalization.cc
Line 51, Patchset 2 (Latest): std::vector<mojom::UserInteractionLatencyPtr> worst_ten_latencies_ptrs;
Michal Mocny . unresolved

Nit: name this "new_interactions" or "other_interactions" or something, at first read I thought this was our cached internal worst_ten (and there is no reason to think the incoming list is necessarily ten)

Line 52, Patchset 2 (Latest): worst_ten_latencies_ptrs.reserve(other->worst_ten_latencies_.size());
Michal Mocny . unresolved

I think you can just std::move the other worst_ten into this temporary, then save on reserving and cloning, or no?

Open in Gerrit

Related details

Attention is currently required from:
  • 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: I163d1b07338edad0547cf3e9e546360757f96547
    Gerrit-Change-Number: 7532264
    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-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 18:32:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    2:18 PM (9 hours ago) 2:18 PM
    to Annie Sullivan, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Michal Mocny

    Johannes Henkel added 4 comments

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

    PTAL! :-)

    File components/page_load_metrics/browser/responsiveness_metrics_normalization.cc
    Line 51, Patchset 2: std::vector<mojom::UserInteractionLatencyPtr> worst_ten_latencies_ptrs;
    Michal Mocny . resolved

    Nit: name this "new_interactions" or "other_interactions" or something, at first read I thought this was our cached internal worst_ten (and there is no reason to think the incoming list is necessarily ten)

    Johannes Henkel

    Done

    Line 52, Patchset 2: worst_ten_latencies_ptrs.reserve(other->worst_ten_latencies_.size());
    Michal Mocny . unresolved

    I think you can just std::move the other worst_ten into this temporary, then save on reserving and cloning, or no?

    Johannes Henkel

    Yeah I can do it if I change the type of worst_ten_latencies_ to hold pointers.

    Line 52, Patchset 2: worst_ten_latencies_ptrs.reserve(other->worst_ten_latencies_.size());
    Michal Mocny . unresolved

    I think you can just std::move the other worst_ten into this temporary, then save on reserving and cloning, or no?

    Johannes Henkel

    The reason for what I had was to deal with the difference between an array of value and an array of pointers. The value array had probably been made the type of the field for efficiency, but now that we want to support this operation, we may be better off with pointers, so I've switched it. Hope it's cool.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • 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: I163d1b07338edad0547cf3e9e546360757f96547
    Gerrit-Change-Number: 7532264
    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-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 19:18:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    2:38 PM (9 hours ago) 2:38 PM
    to Johannes Henkel, Annie Sullivan, Chromium LUCI CQ, chromium...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from 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 3 (Latest):
    Michal Mocny . resolved

    Cheers.

    File components/page_load_metrics/browser/responsiveness_metrics_normalization.cc
    Line 52, Patchset 2: worst_ten_latencies_ptrs.reserve(other->worst_ten_latencies_.size());
    Michal Mocny . unresolved

    I think you can just std::move the other worst_ten into this temporary, then save on reserving and cloning, or no?

    Johannes Henkel

    Yeah I can do it if I change the type of worst_ten_latencies_ to hold pointers.

    Michal Mocny

    Huh, I guess that `mojom::UserInteractionLatency` doesn't support move semantics...

    Looking at the auto generated code there's no explicit move support, but gemini suggests there should be a default copy constructor which move() will fallback to using. I would have hoped there would be a way to explicitly enable move() semantics on mojo structs, but I dont see mention in mojo docs.

    It does seem like using `Ptr` types is the typical solution, which sucks, but seems like the best option.

    Maybe Scott has insights / oppinions?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • 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: I163d1b07338edad0547cf3e9e546360757f96547
    Gerrit-Change-Number: 7532264
    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-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 19:38:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    2:47 PM (9 hours ago) 2:47 PM
    to Michal Mocny, Annie Sullivan, Chromium LUCI CQ, chromium...@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 2 comments

    Votes added by Johannes Henkel

    Commit-Queue+2

    2 comments

    Patchset-level comments
    Johannes Henkel . resolved

    Thanks a lot!

    File components/page_load_metrics/browser/responsiveness_metrics_normalization.cc
    Line 52, Patchset 2: worst_ten_latencies_ptrs.reserve(other->worst_ten_latencies_.size());
    Michal Mocny . resolved

    I think you can just std::move the other worst_ten into this temporary, then save on reserving and cloning, or no?

    Johannes Henkel

    Yeah I can do it if I change the type of worst_ten_latencies_ to hold pointers.

    Michal Mocny

    Huh, I guess that `mojom::UserInteractionLatency` doesn't support move semantics...

    Looking at the auto generated code there's no explicit move support, but gemini suggests there should be a default copy constructor which move() will fallback to using. I would have hoped there would be a way to explicitly enable move() semantics on mojo structs, but I dont see mention in mojo docs.

    It does seem like using `Ptr` types is the typical solution, which sucks, but seems like the best option.

    Maybe Scott has insights / oppinions?

    Johannes Henkel

    I think it's fine with the Ptr types for the elements. What we get from the mojom message is Ptrs anyway due to the way the bindings work, e.g. if you look at the call sites for the AddNewUserInteractionLatencies in this class, the arguments all come in ans vectors of pointers of structs due to the bindings anyway. I think we're ok-ish.

    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: I163d1b07338edad0547cf3e9e546360757f96547
      Gerrit-Change-Number: 7532264
      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-Comment-Date: Fri, 30 Jan 2026 19:47:06 +0000
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      3:37 PM (8 hours ago) 3:37 PM
      to Johannes Henkel, Michal Mocny, Annie Sullivan, chromium...@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 MergeAndClear to INP normalization abstraction in browser

      ResponsivenessMetricsNormalization::MergeAndClear merges the data
      from a second normalization object into the first one, and clears
      the second. This allows us to start a second normalization object
      when a provisional soft navigation (URL change caused by an interaction)
      is detected, and then either continue the separation between the two
      objects upon confirmation, or undo them by invoking MergeAndClear.

      Bug: 480135950
      Change-Id: I163d1b07338edad0547cf3e9e546360757f96547
      Reviewed-by: Annie Sullivan <sull...@chromium.org>
      Reviewed-by: Michal Mocny <mmo...@chromium.org>
      Commit-Queue: Johannes Henkel <joha...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1577479}
      Files:
      • M components/page_load_metrics/browser/responsiveness_metrics_normalization.cc
      • M components/page_load_metrics/browser/responsiveness_metrics_normalization.h
      • M components/page_load_metrics/browser/responsiveness_metrics_normalization_unittest.cc
      Change size: M
      Delta: 3 files changed, 56 insertions(+), 13 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Michal Mocny, +1 by Annie Sullivan
      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: I163d1b07338edad0547cf3e9e546360757f96547
      Gerrit-Change-Number: 7532264
      Gerrit-PatchSet: 4
      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>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages