[iOS] Remove the need for exit-time destructors in some locations [chromium/src : main]

0 views
Skip to first unread message

Sylvain Defresne (Gerrit)

unread,
8:39 AM (11 hours ago) 8:39 AM
to Alexis Hétu, Chromium LUCI CQ, chromium...@chromium.org, ayman...@chromium.org, browser-comp...@chromium.org, dtraino...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, mdjone...@chromium.org, net-r...@chromium.org, sloboda...@chromium.org, tmartino+tran...@chromium.org, yuezhang...@chromium.org
Attention needed from Alexis Hétu

Sylvain Defresne voted and added 5 comments

Votes added by Sylvain Defresne

Code-Review+1

5 comments

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

lgtm

Thank you for the cleanup :-)

File ios/chrome/browser/autofill/model/credit_card/autofill_save_card_infobar_delegate_unittest.mm
Line 39, Patchset 2 (Latest):constexpr char kSaveCreditCardPromptResultIOSPrefix[] =
Sylvain Defresne . unresolved

nit: I think you can use `std::string_view` here

```
constexpr std::string_view kSaveCreditCardPromptResultIOSPrefix =
"Autofill.SaveCreditCardPromptResult.IOS";
```
File ios/chrome/browser/autofill/ui_bundled/bottom_sheet/save_card_bottom_sheet_mediator_unittest.mm
Line 51, Patchset 2 (Latest):constexpr char kSaveCreditCardPromptResultIOSPrefix[] =
Sylvain Defresne . unresolved

ditto, I think we can use `constexpr std::string_view` for all those constants

File ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm
Line 43, Patchset 2 (Latest):constexpr char16_t kFirstInfobarMessageText[] = u"FakeInfobarDelegate1";
Sylvain Defresne . unresolved

nit: you can use `constexpr std::u16string_view` here by changing `AddInfobar(...)` into

```
InfoBarIOS* AddInfobar(InfobarType type, std::u16string_view message_text) {
std::unique_ptr<InfoBarIOS> added_infobar =
std::make_unique<FakeInfobarIOS>(type, std::u16string(message_text));
...
}
```
File ios/chrome/browser/bring_android_tabs/ui_bundled/tab_list_from_android_mediator_unittest.mm
Line 25, Patchset 2 (Latest):const char* const kTestUrls[] = {"http://chromium.org", "http://google.com",
Sylvain Defresne . unresolved

Please change to `std::array<std::string_view>` which is better. This will require a small change where `kTestUrls` is used.

```
constexpr auto kTestUrls = std::to_array<std::string_view>({
"http://chromium.org",
"http://google.com",
});
```

and then

```
for (std::string_view url : kTestUrls) {
std::unique_ptr<synced_sessions::DistantTab> tab =
std::make_unique<synced_sessions::DistantTab>();
tab->virtual_url = GURL(url);
tabs.push_back(std::move(tab));
}
```
Open in Gerrit

Related details

Attention is currently required from:
  • Alexis Hétu
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: Id5a22fc924e6502c27ad03c7742c1aeb87630e91
Gerrit-Change-Number: 7489685
Gerrit-PatchSet: 2
Gerrit-Owner: Alexis Hétu <su...@chromium.org>
Gerrit-Reviewer: Alexis Hétu <su...@chromium.org>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Attention: Alexis Hétu <su...@chromium.org>
Gerrit-Comment-Date: Mon, 19 Jan 2026 13:39:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Sylvain Defresne (Gerrit)

unread,
8:39 AM (11 hours ago) 8:39 AM
to Alexis Hétu, Chromium LUCI CQ, chromium...@chromium.org, ayman...@chromium.org, browser-comp...@chromium.org, dtraino...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, mdjone...@chromium.org, net-r...@chromium.org, sloboda...@chromium.org, tmartino+tran...@chromium.org, yuezhang...@chromium.org
Attention needed from Alexis Hétu

Sylvain Defresne added 1 comment

Patchset-level comments
Sylvain Defresne . resolved

Note: please ignore my comments if they require changing other files (I don't want you to lose my +1) but some of them can be done just locally, so may be worth doing

Open in Gerrit

Related details

Attention is currently required from:
  • Alexis Hétu
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: Id5a22fc924e6502c27ad03c7742c1aeb87630e91
Gerrit-Change-Number: 7489685
Gerrit-PatchSet: 2
Gerrit-Owner: Alexis Hétu <su...@chromium.org>
Gerrit-Reviewer: Alexis Hétu <su...@chromium.org>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Attention: Alexis Hétu <su...@chromium.org>
Gerrit-Comment-Date: Mon, 19 Jan 2026 13:39:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexis Hétu (Gerrit)

unread,
9:17 AM (10 hours ago) 9:17 AM
to Sylvain Defresne, Chromium LUCI CQ, chromium...@chromium.org, ayman...@chromium.org, browser-comp...@chromium.org, dtraino...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, mdjone...@chromium.org, net-r...@chromium.org, sloboda...@chromium.org, tmartino+tran...@chromium.org, yuezhang...@chromium.org

Alexis Hétu voted and added 5 comments

Votes added by Alexis Hétu

Commit-Queue+2

5 comments

Patchset-level comments
Sylvain Defresne . resolved

Note: please ignore my comments if they require changing other files (I don't want you to lose my +1) but some of them can be done just locally, so may be worth doing

Alexis Hétu

All done, thanks!

File ios/chrome/browser/autofill/model/credit_card/autofill_save_card_infobar_delegate_unittest.mm
Line 39, Patchset 2:constexpr char kSaveCreditCardPromptResultIOSPrefix[] =
Sylvain Defresne . resolved

nit: I think you can use `std::string_view` here

```
constexpr std::string_view kSaveCreditCardPromptResultIOSPrefix =
"Autofill.SaveCreditCardPromptResult.IOS";
```
Alexis Hétu

Done

File ios/chrome/browser/autofill/ui_bundled/bottom_sheet/save_card_bottom_sheet_mediator_unittest.mm
Line 51, Patchset 2:constexpr char kSaveCreditCardPromptResultIOSPrefix[] =
Sylvain Defresne . resolved

ditto, I think we can use `constexpr std::string_view` for all those constants

Alexis Hétu

Done

File ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm
Line 43, Patchset 2:constexpr char16_t kFirstInfobarMessageText[] = u"FakeInfobarDelegate1";
Sylvain Defresne . resolved

nit: you can use `constexpr std::u16string_view` here by changing `AddInfobar(...)` into

```
InfoBarIOS* AddInfobar(InfobarType type, std::u16string_view message_text) {
std::unique_ptr<InfoBarIOS> added_infobar =
std::make_unique<FakeInfobarIOS>(type, std::u16string(message_text));
...
}
```
Alexis Hétu

Done

File ios/chrome/browser/bring_android_tabs/ui_bundled/tab_list_from_android_mediator_unittest.mm
Line 25, Patchset 2:const char* const kTestUrls[] = {"http://chromium.org", "http://google.com",
Sylvain Defresne . resolved

Please change to `std::array<std::string_view>` which is better. This will require a small change where `kTestUrls` is used.

```
constexpr auto kTestUrls = std::to_array<std::string_view>({
"http://chromium.org",
"http://google.com",
});
```

and then

```
for (std::string_view url : kTestUrls) {
std::unique_ptr<synced_sessions::DistantTab> tab =
std::make_unique<synced_sessions::DistantTab>();
tab->virtual_url = GURL(url);
tabs.push_back(std::move(tab));
}
```
Alexis Hétu

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: Id5a22fc924e6502c27ad03c7742c1aeb87630e91
    Gerrit-Change-Number: 7489685
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alexis Hétu <su...@chromium.org>
    Gerrit-Reviewer: Alexis Hétu <su...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 Jan 2026 14:17:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Sylvain Defresne <sdef...@chromium.org>
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    10:26 AM (9 hours ago) 10:26 AM
    to Alexis Hétu, Sylvain Defresne, chromium...@chromium.org, ayman...@chromium.org, browser-comp...@chromium.org, dtraino...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, mdjone...@chromium.org, net-r...@chromium.org, sloboda...@chromium.org, tmartino+tran...@chromium.org, yuezhang...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

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

    ```
    The name of the file: ios/chrome/browser/autofill/ui_bundled/bottom_sheet/save_card_bottom_sheet_mediator_unittest.mm
    Insertions: 6, Deletions: 6.

    The diff is too large to show. Please review the diff.
    ```
    ```
    The name of the file: ios/chrome/browser/bring_android_tabs/ui_bundled/tab_list_from_android_mediator_unittest.mm
    Insertions: 3, Deletions: 3.

    The diff is too large to show. Please review the diff.
    ```
    ```
    The name of the file: ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm
    Insertions: 8, Deletions: 6.

    The diff is too large to show. Please review the diff.
    ```
    ```
    The name of the file: ios/chrome/browser/autofill/model/credit_card/autofill_save_card_infobar_delegate_unittest.mm
    Insertions: 1, Deletions: 1.

    The diff is too large to show. Please review the diff.
    ```

    Change information

    Commit message:
    [iOS] Remove the need for exit-time destructors in some locations

    This CL removes the need for exit time destructors in iOS code
    in a few locations where it is trivial to do so.
    Bug: 40031409
    Change-Id: Id5a22fc924e6502c27ad03c7742c1aeb87630e91
    Reviewed-by: Sylvain Defresne <sdef...@chromium.org>
    Commit-Queue: Alexis Hétu <su...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1571196}
    Files:
    Change size: M
    Delta: 29 files changed, 46 insertions(+), 111 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Sylvain Defresne
    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: Id5a22fc924e6502c27ad03c7742c1aeb87630e91
    Gerrit-Change-Number: 7489685
    Gerrit-PatchSet: 4
    Gerrit-Owner: Alexis Hétu <su...@chromium.org>
    Gerrit-Reviewer: Alexis Hétu <su...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages