[iOS][PageInfo] Add certificate detail model, mediator, utils, and fix OID crash [chromium/src : main]

0 views
Skip to first unread message

Tian Ye (Gerrit)

unread,
Mar 19, 2026, 7:56:38 AMMar 19
to Filipa Senra, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Filipa Senra and Sylvain Defresne

Tian Ye added 3 comments

File ios/chrome/browser/page_info/certificate/coordinator/page_info_certificate_chain_mediator.mm
Line 36, Patchset 2:NSString* FormatTime(const base::Time& time) {
Sylvain Defresne . resolved

`base::Time` is a wrapper around an integral value. It is better to pass it by value than by reference. So

```
NSString* FormatTime(base::Time time) {
...
```
Tian Ye

Done

Line 116, Patchset 2:- (PageInfoSiteCertificateDetailInfo*)certificateDetailInfoFromX509Model:
Sylvain Defresne . resolved

I looks like this method and all the helper methods don't use `self`. I think it would be better to change them to free functions.

Additionally, since they are complex, I would move them to a new file, make them public and test test individually.

So `page_info_site_certificate_chain_utils.h` file that contains functions like this:

```
// Creates a PageInfoSiteCertificateDetailInfo from an X509CertificateModel.
PageInfoSiteCertificateDetailInfo*
CertificateDetailInfoFromX509Model(const X509CertificateModel& model);

// Creates a PageInfoCertificateSignatureInfo from an X509CertificateModel.
PageInfoCertificateSignatureInfo*
CertificateSignatureInfoFromX509Model(const X509CertificateModel& model);

...
```

Tian Ye

Done

Line 126, Patchset 2: // Signature info.
Sylvain Defresne . resolved

I don't think those comments bring any added value. This is self-explanatory code as the variable and methods names are explicitly. Please remove them.

Tian Ye

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Filipa Senra
  • Sylvain Defresne
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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
Gerrit-Change-Number: 7683760
Gerrit-PatchSet: 5
Gerrit-Owner: Tian Ye <tia...@microsoft.com>
Gerrit-Reviewer: Filipa Senra <fse...@google.com>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
Gerrit-Attention: Filipa Senra <fse...@google.com>
Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Comment-Date: Thu, 19 Mar 2026 11:56:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sylvain Defresne <sdef...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Filipa Senra (Gerrit)

unread,
Mar 19, 2026, 1:05:13 PMMar 19
to Tian Ye, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Sylvain Defresne and Tian Ye

Filipa Senra voted and added 4 comments

Votes added by Filipa Senra

Code-Review+1

4 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Filipa Senra . resolved

lgtm % nits

File ios/chrome/browser/page_info/certificate/coordinator/page_info_certificate_chain_mediator.mm
Line 54, Patchset 5 (Latest): if (!_webState) {
Filipa Senra . unresolved

optional nit: you can probably combine the two ifs.

File ios/chrome/browser/page_info/certificate/coordinator/page_info_site_certificate_chain_utils.mm
Line 57, Patchset 5 (Latest):PageInfoCertificateSignatureInfo* SignatureInfoFromModel(
Filipa Senra . unresolved

nit: it's a bit unfortunate that all the functions bellow are on the header file just for testing purposes. would it be possible to still test this functionality, without putting them there? could you instead use CertificateDetailInfoFromX509Model and check for a specific field?

File ios/chrome/browser/page_info/certificate/ui/page_info_certificate_chain_consumer.h
Line 21, Patchset 5 (Latest):// then intermediates). If this method is not called, the certificate row should
Filipa Senra . unresolved

nit: or the array is empty?

Open in Gerrit

Related details

Attention is currently required from:
  • Sylvain Defresne
  • Tian Ye
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
Gerrit-Change-Number: 7683760
Gerrit-PatchSet: 5
Gerrit-Owner: Tian Ye <tia...@microsoft.com>
Gerrit-Reviewer: Filipa Senra <fse...@google.com>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
Gerrit-Attention: Tian Ye <tia...@microsoft.com>
Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Comment-Date: Thu, 19 Mar 2026 17:04:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Tian Ye (Gerrit)

unread,
Mar 20, 2026, 2:26:02 AMMar 20
to Filipa Senra, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
Attention needed from Filipa Senra and Sylvain Defresne

Tian Ye added 3 comments

File ios/chrome/browser/page_info/certificate/coordinator/page_info_certificate_chain_mediator.mm
Line 54, Patchset 5: if (!_webState) {
Filipa Senra . resolved

optional nit: you can probably combine the two ifs.

Tian Ye

Done

File ios/chrome/browser/page_info/certificate/coordinator/page_info_site_certificate_chain_utils.mm
Line 57, Patchset 5:PageInfoCertificateSignatureInfo* SignatureInfoFromModel(
Filipa Senra . resolved

nit: it's a bit unfortunate that all the functions bellow are on the header file just for testing purposes. would it be possible to still test this functionality, without putting them there? could you instead use CertificateDetailInfoFromX509Model and check for a specific field?

Tian Ye

Done

File ios/chrome/browser/page_info/certificate/ui/page_info_certificate_chain_consumer.h
Line 21, Patchset 5:// then intermediates). If this method is not called, the certificate row should
Filipa Senra . resolved

nit: or the array is empty?

Tian Ye

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Filipa Senra
  • 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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
    Gerrit-Change-Number: 7683760
    Gerrit-PatchSet: 6
    Gerrit-Owner: Tian Ye <tia...@microsoft.com>
    Gerrit-Reviewer: Filipa Senra <fse...@google.com>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
    Gerrit-Attention: Filipa Senra <fse...@google.com>
    Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Mar 2026 06:25:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Filipa Senra <fse...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sylvain Defresne (Gerrit)

    unread,
    Mar 23, 2026, 6:43:49 AMMar 23
    to Tian Ye, Filipa Senra, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
    Attention needed from Filipa Senra and Tian Ye

    Sylvain Defresne voted and added 2 comments

    Votes added by Sylvain Defresne

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 6 (Latest):
    Sylvain Defresne . resolved

    lgtm once the comment has been adressed

    File ios/chrome/browser/page_info/certificate/coordinator/page_info_certificate_chain_mediator.mm
    Line 50, Patchset 6 (Latest): if (!self.consumer || !_webState) {
    Sylvain Defresne . unresolved

    I think you should also test whether `WebState` is realized or not. The reason is that unrealized `WebState` does not have a `NavigationManager`, but calling `GetNavigationManager()` on it will cause the object to be created, and we want to avoid forcing realization of `WebState`s.

    So

    ```
    if (!self.consumer || !_webState || !_webState->IsRealized()) {
    return;
    }
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Filipa Senra
    • Tian Ye
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
      Gerrit-Change-Number: 7683760
      Gerrit-PatchSet: 6
      Gerrit-Owner: Tian Ye <tia...@microsoft.com>
      Gerrit-Reviewer: Filipa Senra <fse...@google.com>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
      Gerrit-Attention: Tian Ye <tia...@microsoft.com>
      Gerrit-Attention: Filipa Senra <fse...@google.com>
      Gerrit-Comment-Date: Mon, 23 Mar 2026 10:43:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Filipa Senra (Gerrit)

      unread,
      Mar 23, 2026, 8:03:21 AMMar 23
      to Tian Ye, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
      Attention needed from Tian Ye

      Filipa Senra voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Tian Ye
      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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
        Gerrit-Change-Number: 7683760
        Gerrit-PatchSet: 6
        Gerrit-Owner: Tian Ye <tia...@microsoft.com>
        Gerrit-Reviewer: Filipa Senra <fse...@google.com>
        Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
        Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
        Gerrit-Attention: Tian Ye <tia...@microsoft.com>
        Gerrit-Comment-Date: Mon, 23 Mar 2026 12:03:05 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Tian Ye (Gerrit)

        unread,
        Mar 23, 2026, 9:36:20 AMMar 23
        to Filipa Senra, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
        Attention needed from Filipa Senra and Sylvain Defresne

        Tian Ye added 1 comment

        File ios/chrome/browser/page_info/certificate/coordinator/page_info_certificate_chain_mediator.mm
        Line 50, Patchset 6: if (!self.consumer || !_webState) {
        Sylvain Defresne . resolved

        I think you should also test whether `WebState` is realized or not. The reason is that unrealized `WebState` does not have a `NavigationManager`, but calling `GetNavigationManager()` on it will cause the object to be created, and we want to avoid forcing realization of `WebState`s.

        So

        ```
        if (!self.consumer || !_webState || !_webState->IsRealized()) {
        return;
        }
        ```
        Tian Ye

        Thanks for the explanation. Done.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Filipa Senra
        • 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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
          Gerrit-Change-Number: 7683760
          Gerrit-PatchSet: 7
          Gerrit-Owner: Tian Ye <tia...@microsoft.com>
          Gerrit-Reviewer: Filipa Senra <fse...@google.com>
          Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
          Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
          Gerrit-Attention: Filipa Senra <fse...@google.com>
          Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
          Gerrit-Comment-Date: Mon, 23 Mar 2026 13:36:12 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Sylvain Defresne <sdef...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Matt Mueller (Gerrit)

          unread,
          Mar 23, 2026, 11:44:06 AMMar 23
          to Tian Ye, Matt Mueller, Filipa Senra, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org
          Attention needed from Filipa Senra, Sylvain Defresne and Tian Ye

          Matt Mueller voted and added 1 comment

          Votes added by Matt Mueller

          Code-Review-1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 7 (Latest):
          Matt Mueller . unresolved

          please address my comment on earlier CL before landing

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Filipa Senra
          • Sylvain Defresne
          • Tian Ye
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement is blockingCode-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: Iee0a05a4bf7c486f1b0e2e3628dfe010b723fa58
            Gerrit-Change-Number: 7683760
            Gerrit-PatchSet: 7
            Gerrit-Owner: Tian Ye <tia...@microsoft.com>
            Gerrit-Reviewer: Filipa Senra <fse...@google.com>
            Gerrit-Reviewer: Matt Mueller <ma...@chromium.org>
            Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
            Gerrit-CC: Permissions Reviews <permissio...@chromium.org>
            Gerrit-Attention: Tian Ye <tia...@microsoft.com>
            Gerrit-Attention: Filipa Senra <fse...@google.com>
            Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
            Gerrit-Comment-Date: Mon, 23 Mar 2026 15:43:58 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            blocking_requirement
            unsatisfied_requirement
            open
            diffy

            Tian Ye (Gerrit)

            unread,
            2:46 AM (5 hours ago) 2:46 AM
            to Matt Mueller, Filipa Senra, Sylvain Defresne, chromium...@chromium.org, Permissions Reviews, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org

            Tian Ye abandoned this change.

            View Change

            Abandoned commit another CL

            Tian Ye abandoned this change

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is blockingCode-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: abandon
            satisfied_requirement
            blocking_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages