[ios] Fix metrics recorded by WebStateListMetricsBrowserAgent [chromium/src : main]

0 views
Skip to first unread message

Sylvain Defresne (Gerrit)

unread,
Dec 4, 2025, 6:07:57 AM (2 days ago) Dec 4
to Mark Cogan, Alexandra Pereira, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, dullweb...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, msrame...@chromium.org
Attention needed from Alexandra Pereira, Mark Cogan and Sylvain Defresne

Sylvain Defresne voted and added 2 comments

Votes added by Sylvain Defresne

Commit-Queue+1

2 comments

Patchset-level comments
File-level comment, Patchset 2:
Sylvain Defresne . resolved

alexandrasp: can you do a first pass review?
marq: can you review after alexandrasp and then send to CQ+2 if this lgtm to you both?

File ios/chrome/browser/metrics/model/tab_usage_recorder_service.mm
File-level comment, Patchset 1:
Sylvain Defresne . resolved

Please fix this WARNING reported by Large Change: This change adds 476 lines of production code. Consider splitting this change in...

This change adds 476 lines of production code. Consider splitting this change into smaller ones.
Small changes get reviewed faster and more thoroughly, are less likely to introduce bugs, and are easier to roll back if needed.
You can bypass this warning by adding 'BYPASS_LARGE_CHANGE_WARNING: <reason>' to the change description. (Google-internal: See go/large-change-nudge)

Open in Gerrit

Related details

Attention is currently required from:
  • Alexandra Pereira
  • Mark Cogan
  • Sylvain Defresne
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I44e9f1855121d9a7b5aab332f8da180e655de8c5
Gerrit-Change-Number: 7224735
Gerrit-PatchSet: 2
Gerrit-Owner: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Reviewer: Alexandra Pereira <alexa...@google.com>
Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Attention: Mark Cogan <ma...@chromium.org>
Gerrit-Attention: Alexandra Pereira <alexa...@google.com>
Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Dec 2025 11:07:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Mark Cogan (Gerrit)

unread,
Dec 5, 2025, 8:10:29 AM (19 hours ago) Dec 5
to Sylvain Defresne, Alexandra Pereira, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, dullweb...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, msrame...@chromium.org
Attention needed from Alexandra Pereira and Sylvain Defresne

Mark Cogan voted and added 1 comment

Votes added by Mark Cogan

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Mark Cogan . resolved

LGTM, although I'm wondering why profile-scoping (rather than app-scoping) is correct here? Is it because we care about the active tabs at the time of the crash which, for each scene, will be per-profile?

Open in Gerrit

Related details

Attention is currently required from:
  • Alexandra Pereira
  • Sylvain Defresne
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: I44e9f1855121d9a7b5aab332f8da180e655de8c5
    Gerrit-Change-Number: 7224735
    Gerrit-PatchSet: 3
    Gerrit-Owner: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Reviewer: Alexandra Pereira <alexa...@google.com>
    Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Attention: Alexandra Pereira <alexa...@google.com>
    Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Dec 2025 13:10:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Alexandra Pereira (Gerrit)

    unread,
    12:10 AM (3 hours ago) 12:10 AM
    to Sylvain Defresne, Mark Cogan, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, dullweb...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, msrame...@chromium.org
    Attention needed from Sylvain Defresne

    Alexandra Pereira added 7 comments

    Patchset-level comments
    Mark Cogan . resolved

    LGTM, although I'm wondering why profile-scoping (rather than app-scoping) is correct here? Is it because we care about the active tabs at the time of the crash which, for each scene, will be per-profile?

    Alexandra Pereira

    IIUC, it is exactly because we want it to be per-profile. It will make it easier and the right way to have profile-aware crash keys.

    Alexandra Pereira . unresolved

    Hi Sylvain, thanks for the CL! I left some comments. I also wanted to ask: is there a reason we don't have any tests here? Would it be possible to cover this with unit tests?

    File ios/chrome/browser/metrics/model/tab_usage_recorder_service.h
    Line 49, Patchset 3 (Latest): const std::vector<web::WebState*>& restored_web_states) final;
    Alexandra Pereira . unresolved

    don't we need to have web namespace?

    Line 49, Patchset 3 (Latest): const std::vector<web::WebState*>& restored_web_states) final;
    Alexandra Pereira . unresolved

    isn't it necessary to import vector?

    Line 12, Patchset 3 (Latest):#include "base/memory/raw_ref.h"
    Alexandra Pereira . unresolved

    do we need base/memory/raw_ref.h?

    File ios/chrome/browser/metrics/model/tab_usage_recorder_service.mm
    Line 72, Patchset 3 (Latest): CGFloat red = 1.0;
    Alexandra Pereira . unresolved

    are we able to use CGFLoat without importing UIKit?

    Line 386, Patchset 3 (Latest): helpers_.insert(std::make_pair(type, std::make_unique<Helper>(type)));
    Alexandra Pereira . unresolved

    isn't it necessary to import utility ?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sylvain Defresne
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I44e9f1855121d9a7b5aab332f8da180e655de8c5
    Gerrit-Change-Number: 7224735
    Gerrit-PatchSet: 3
    Gerrit-Owner: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Reviewer: Alexandra Pereira <alexa...@google.com>
    Gerrit-Reviewer: Mark Cogan <ma...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Comment-Date: Sat, 06 Dec 2025 05:10:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mark Cogan <ma...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages