Fix UKM spam for PartitionedCookiePresentV3 [chromium/src : main]

0 views
Skip to first unread message

Johann Hofmann (Gerrit)

unread,
Apr 2, 2026, 12:10:13 AM (4 days ago) Apr 2
to chromium...@chromium.org, net-r...@chromium.org, navigation...@chromium.org, alexmo...@chromium.org, creis...@chromium.org

Johann Hofmann has uploaded the change for review

Commit message

Fix UKM spam for PartitionedCookiePresentV3

Move the recording of PartitionedCookiePresentV3 outside the cookie
access loop in EmitCookieWarningsAndMetrics. It is now recorded at
most once per request if any partitioned cookies exist.

Also added a regression browser test to verify that accessing multiple
partitioned cookies in a single request only logs the event once.
Bug: 497285454
Change-Id: Ie8ede1535983a7cca97e4203409829d3704928ff

Change diff


Change information

Files:
  • M chrome/browser/net/cookie_use_counter_browsertest.cc
  • M content/browser/renderer_host/cookie_utils.cc
Change size: S
Delta: 2 files changed, 25 insertions(+), 3 deletions(-)
Open in Gerrit

Related details

Attention set is empty
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: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie8ede1535983a7cca97e4203409829d3704928ff
Gerrit-Change-Number: 7722139
Gerrit-PatchSet: 1
Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Johann Hofmann (Gerrit)

unread,
Apr 2, 2026, 12:16:35 AM (4 days ago) Apr 2
to Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org

Johann Hofmann added 2 comments

File chrome/browser/net/cookie_use_counter_browsertest.cc
Line 191, Patchset 3 (Latest): // New code: logs 1 time (once per request).
Johann Hofmann . unresolved

Remove this comment

File content/browser/renderer_host/cookie_utils.cc
Line 159, Patchset 3 (Latest):// "receive-cookie-deprecation" and the RenderFrameHost is not prerendering.
Johann Hofmann . unresolved

So it seems like we're just dropping these checks now? Is that intentional?

Open in Gerrit

Related details

Attention set is empty
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: Ie8ede1535983a7cca97e4203409829d3704928ff
    Gerrit-Change-Number: 7722139
    Gerrit-PatchSet: 3
    Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
    Gerrit-CC: Jerome Jiang <ji...@chromium.org>
    Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 04:16:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johann Hofmann (Gerrit)

    unread,
    Apr 2, 2026, 12:26:41 AM (4 days ago) Apr 2
    to Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org

    Johann Hofmann voted and added 3 comments

    Votes added by Johann Hofmann

    Commit-Queue+1

    3 comments

    File chrome/browser/net/cookie_use_counter_browsertest.cc
    Line 191, Patchset 3: // New code: logs 1 time (once per request).
    Johann Hofmann . resolved

    Remove this comment

    Johann Hofmann

    Done

    File content/browser/renderer_host/cookie_utils.cc
    Line 159, Patchset 3:// "receive-cookie-deprecation" and the RenderFrameHost is not prerendering.
    Johann Hofmann . resolved

    So it seems like we're just dropping these checks now? Is that intentional?

    Johann Hofmann

    Done

    Line 458, Patchset 4 (Latest): "receive-cookie-deprecation") {
    Johann Hofmann . unresolved

    We can probably clean this up soon, but not as urgent as this fix...

    Open in Gerrit

    Related details

    Attention set is empty
    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: Ie8ede1535983a7cca97e4203409829d3704928ff
    Gerrit-Change-Number: 7722139
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
    Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
    Gerrit-CC: Jerome Jiang <ji...@chromium.org>
    Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 04:26:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Johann Hofmann <joha...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Maks Orlovich (Gerrit)

    unread,
    Apr 3, 2026, 3:32:01 PM (2 days ago) Apr 3
    to Johann Hofmann, Arthur Sonzogni, Chromium LUCI CQ, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org
    Attention needed from Arthur Sonzogni and Johann Hofmann

    Maks Orlovich voted and added 1 comment

    Votes added by Maks Orlovich

    Code-Review+1

    1 comment

    File chrome/browser/net/cookie_use_counter_browsertest.cc
    Line 181, Patchset 6 (Latest): ukm_recorder.GetEntriesByName("PartitionedCookiePresentV3").size();
    Maks Orlovich . unresolved

    Should it be V4 now?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Arthur Sonzogni
    • Johann Hofmann
    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: Ie8ede1535983a7cca97e4203409829d3704928ff
      Gerrit-Change-Number: 7722139
      Gerrit-PatchSet: 6
      Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Maks Orlovich <morl...@chromium.org>
      Gerrit-CC: Jerome Jiang <ji...@chromium.org>
      Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
      Gerrit-Attention: Johann Hofmann <joha...@chromium.org>
      Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 19:31:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johann Hofmann (Gerrit)

      unread,
      Apr 3, 2026, 4:09:48 PM (2 days ago) Apr 3
      to Bo Liu, Maks Orlovich, Chromium LUCI CQ, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org
      Attention needed from Bo Liu

      Johann Hofmann added 2 comments

      Patchset-level comments
      File-level comment, Patchset 6 (Latest):
      Johann Hofmann . resolved

      Swapping out Arthur since we're out of his timezone now...

      File chrome/browser/net/cookie_use_counter_browsertest.cc
      Line 181, Patchset 6 (Latest): ukm_recorder.GetEntriesByName("PartitionedCookiePresentV3").size();
      Maks Orlovich . resolved

      Should it be V4 now?

      Johann Hofmann

      I figured given that V3 never made it out of Canary and this is more of a bugfix for V3 I'd leave the name as is. But let me know if you feel strongly about that.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Bo Liu
      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: Ie8ede1535983a7cca97e4203409829d3704928ff
      Gerrit-Change-Number: 7722139
      Gerrit-PatchSet: 6
      Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
      Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Maks Orlovich <morl...@chromium.org>
      Gerrit-CC: Jerome Jiang <ji...@chromium.org>
      Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
      Gerrit-Attention: Bo Liu <bo...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 20:09:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Maks Orlovich <morl...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Maks Orlovich (Gerrit)

      unread,
      Apr 3, 2026, 4:13:34 PM (2 days ago) Apr 3
      to Johann Hofmann, Bo Liu, Chromium LUCI CQ, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org
      Attention needed from Bo Liu and Johann Hofmann

      Maks Orlovich added 1 comment

      File chrome/browser/net/cookie_use_counter_browsertest.cc
      Line 181, Patchset 6 (Latest): ukm_recorder.GetEntriesByName("PartitionedCookiePresentV3").size();
      Maks Orlovich . resolved

      Should it be V4 now?

      Johann Hofmann

      I figured given that V3 never made it out of Canary and this is more of a bugfix for V3 I'd leave the name as is. But let me know if you feel strongly about that.

      Maks Orlovich

      SGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Bo Liu
      • Johann Hofmann
      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: Ie8ede1535983a7cca97e4203409829d3704928ff
      Gerrit-Change-Number: 7722139
      Gerrit-PatchSet: 6
      Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
      Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Maks Orlovich <morl...@chromium.org>
      Gerrit-CC: Jerome Jiang <ji...@chromium.org>
      Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
      Gerrit-Attention: Johann Hofmann <joha...@chromium.org>
      Gerrit-Attention: Bo Liu <bo...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 20:13:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Johann Hofmann <joha...@chromium.org>
      Comment-In-Reply-To: Maks Orlovich <morl...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Bo Liu (Gerrit)

      unread,
      Apr 3, 2026, 4:21:33 PM (2 days ago) Apr 3
      to Johann Hofmann, Bo Liu, Maks Orlovich, Chromium LUCI CQ, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org
      Attention needed from Johann Hofmann

      Bo Liu voted and added 1 comment

      Votes added by Bo Liu

      Code-Review+1

      1 comment

      Patchset-level comments
      Bo Liu . resolved

      stamp

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Johann Hofmann
      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: Ie8ede1535983a7cca97e4203409829d3704928ff
      Gerrit-Change-Number: 7722139
      Gerrit-PatchSet: 6
      Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
      Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
      Gerrit-Reviewer: Maks Orlovich <morl...@chromium.org>
      Gerrit-CC: Jerome Jiang <ji...@chromium.org>
      Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
      Gerrit-Attention: Johann Hofmann <joha...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 20:21:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johann Hofmann (Gerrit)

      unread,
      Apr 3, 2026, 4:28:04 PM (2 days ago) Apr 3
      to Bo Liu, Maks Orlovich, Chromium LUCI CQ, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org

      Johann Hofmann voted and added 1 comment

      Votes added by Johann Hofmann

      Commit-Queue+2

      1 comment

      File content/browser/renderer_host/cookie_utils.cc
      Line 458, Patchset 4: "receive-cookie-deprecation") {
      Johann Hofmann . resolved

      We can probably clean this up soon, but not as urgent as this fix...

      Johann Hofmann

      Done

      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: Ie8ede1535983a7cca97e4203409829d3704928ff
        Gerrit-Change-Number: 7722139
        Gerrit-PatchSet: 6
        Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
        Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
        Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
        Gerrit-Reviewer: Maks Orlovich <morl...@chromium.org>
        Gerrit-CC: Jerome Jiang <ji...@chromium.org>
        Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
        Gerrit-Comment-Date: Fri, 03 Apr 2026 20:28:00 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Johann Hofmann <joha...@chromium.org>
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Apr 3, 2026, 5:36:52 PM (2 days ago) Apr 3
        to Johann Hofmann, Bo Liu, Maks Orlovich, Jerome Jiang, Mirko Bonadei, AyeAye, chromium...@chromium.org, fgal...@chromium.org, jshin...@chromium.org, mar...@chromium.org, feature-me...@chromium.org, chrome-intell...@chromium.org, chrome-intelligence-te...@google.com, jz...@chromium.org, devtools...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org, net-r...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Fix UKM spam for PartitionedCookiePresentV3

        Move the recording of PartitionedCookiePresentV3 outside the cookie
        access loop in EmitCookieWarningsAndMetrics. It is now recorded at
        most once per request if any partitioned cookies exist.

        Also added a regression browser test to verify that accessing multiple
        partitioned cookies in a single request only logs the event once.
        Bug: 497285454
        Change-Id: Ie8ede1535983a7cca97e4203409829d3704928ff
        Reviewed-by: Bo Liu <bo...@chromium.org>
        Commit-Queue: Johann Hofmann <joha...@chromium.org>
        Reviewed-by: Maks Orlovich <morl...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1609962}
        Files:
        • M chrome/browser/net/cookie_use_counter_browsertest.cc
        • M content/browser/renderer_host/cookie_utils.cc
        Change size: S
        Delta: 2 files changed, 36 insertions(+), 9 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Maks Orlovich, +1 by Bo Liu
        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: Ie8ede1535983a7cca97e4203409829d3704928ff
        Gerrit-Change-Number: 7722139
        Gerrit-PatchSet: 7
        Gerrit-Owner: Johann Hofmann <joha...@chromium.org>
        Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Johann Hofmann <joha...@chromium.org>
        Gerrit-Reviewer: Maks Orlovich <morl...@chromium.org>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages