Add user agent override API to WebState [chromium/src : main]

0 views
Skip to first unread message

Louis Romero (Gerrit)

unread,
Mar 20, 2026, 8:04:18 PM (3 days ago) Mar 20
to Louis Romero, Sylvain Defresne, Mike Dougherty, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, ios-revie...@chromium.org, feature-me...@chromium.org, marq+...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org
Attention needed from Mike Dougherty and Sylvain Defresne

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Mike Dougherty
  • 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: Id7827aa481960724cb331cb1693a2286b8567bd2
Gerrit-Change-Number: 7675099
Gerrit-PatchSet: 6
Gerrit-Owner: Louis Romero <lpro...@google.com>
Gerrit-Reviewer: Louis Romero <lpro...@google.com>
Gerrit-Reviewer: Mike Dougherty <mich...@chromium.org>
Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Attention: Sylvain Defresne <sdef...@chromium.org>
Gerrit-Attention: Mike Dougherty <mich...@chromium.org>
Gerrit-Comment-Date: Sat, 21 Mar 2026 00:04:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sylvain Defresne (Gerrit)

unread,
7:03 AM (6 hours ago) 7:03 AM
to Louis Romero, Mike Dougherty, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, ios-revie...@chromium.org, feature-me...@chromium.org, marq+...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org
Attention needed from Louis Romero and Mike Dougherty

Sylvain Defresne added 1 comment

File ios/web/web_state/web_state_impl.mm
Line 74, Patchset 6 (Latest):const std::string kEmptyString = "";
Sylvain Defresne . unresolved

`std::string` has a non default destructor, so this adds a global destructor, which will fail on a bot later.

Instead either:

  • declare the constant at the function scope
    ```
const std::string& WebStateImpl::GetUserAgentOverride() const {
...
static constexpr std::string kEmptyString;
return *kEmptyString;
}
```
  • change the API to return `std::string`.
Open in Gerrit

Related details

Attention is currently required from:
  • Louis Romero
  • Mike Dougherty
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: Id7827aa481960724cb331cb1693a2286b8567bd2
    Gerrit-Change-Number: 7675099
    Gerrit-PatchSet: 6
    Gerrit-Owner: Louis Romero <lpro...@google.com>
    Gerrit-Reviewer: Louis Romero <lpro...@google.com>
    Gerrit-Reviewer: Mike Dougherty <mich...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Attention: Louis Romero <lpro...@google.com>
    Gerrit-Attention: Mike Dougherty <mich...@chromium.org>
    Gerrit-Comment-Date: Mon, 23 Mar 2026 11:02:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sylvain Defresne (Gerrit)

    unread,
    7:10 AM (6 hours ago) 7:10 AM
    to Louis Romero, Mike Dougherty, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, ios-revie...@chromium.org, feature-me...@chromium.org, marq+...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org
    Attention needed from Louis Romero and Mike Dougherty

    Sylvain Defresne added 1 comment

    File ios/web/web_state/web_state_impl.mm
    Line 74, Patchset 6 (Latest):const std::string kEmptyString = "";
    Sylvain Defresne . unresolved

    `std::string` has a non default destructor, so this adds a global destructor, which will fail on a bot later.

    Instead either:

    • declare the constant at the function scope
        ```
    const std::string& WebStateImpl::GetUserAgentOverride() const {
    ...
    static constexpr std::string kEmptyString;
    return *kEmptyString;
    }
    ```
    • change the API to return `std::string`.
    Sylvain Defresne

    The `*` was not supposed to be here (typo).

    Gerrit-Comment-Date: Mon, 23 Mar 2026 11:10:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Sylvain Defresne <sdef...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sylvain Defresne (Gerrit)

    unread,
    9:30 AM (4 hours ago) 9:30 AM
    to Louis Romero, Mike Dougherty, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, ios-revie...@chromium.org, feature-me...@chromium.org, marq+...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org
    Attention needed from Louis Romero and Mike Dougherty

    Sylvain Defresne voted and added 1 comment

    Votes added by Sylvain Defresne

    Code-Review+1

    1 comment

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

    lgtm

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Louis Romero
    • Mike Dougherty
    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: Id7827aa481960724cb331cb1693a2286b8567bd2
    Gerrit-Change-Number: 7675099
    Gerrit-PatchSet: 6
    Gerrit-Owner: Louis Romero <lpro...@google.com>
    Gerrit-Reviewer: Louis Romero <lpro...@google.com>
    Gerrit-Reviewer: Mike Dougherty <mich...@chromium.org>
    Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
    Gerrit-Attention: Louis Romero <lpro...@google.com>
    Gerrit-Attention: Mike Dougherty <mich...@chromium.org>
    Gerrit-Comment-Date: Mon, 23 Mar 2026 13:30:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Louis Romero (Gerrit)

    unread,
    10:11 AM (3 hours ago) 10:11 AM
    to Louis Romero, Sylvain Defresne, Mike Dougherty, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, ios-revie...@chromium.org, feature-me...@chromium.org, marq+...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org
    Attention needed from Mike Dougherty

    Louis Romero added 1 comment

    File ios/web/web_state/web_state_impl.mm
    Line 74, Patchset 6:const std::string kEmptyString = "";
    Sylvain Defresne . resolved

    `std::string` has a non default destructor, so this adds a global destructor, which will fail on a bot later.

    Instead either:

    • declare the constant at the function scope
        ```
    const std::string& WebStateImpl::GetUserAgentOverride() const {
    ...
    static constexpr std::string kEmptyString;
    return *kEmptyString;
    }
    ```
    • change the API to return `std::string`.
    Sylvain Defresne

    The `*` was not supposed to be here (typo).

    Louis Romero

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mike Dougherty
    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: Id7827aa481960724cb331cb1693a2286b8567bd2
      Gerrit-Change-Number: 7675099
      Gerrit-PatchSet: 7
      Gerrit-Owner: Louis Romero <lpro...@google.com>
      Gerrit-Reviewer: Louis Romero <lpro...@google.com>
      Gerrit-Reviewer: Mike Dougherty <mich...@chromium.org>
      Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
      Gerrit-Attention: Mike Dougherty <mich...@chromium.org>
      Gerrit-Comment-Date: Mon, 23 Mar 2026 14:11:21 +0000
      satisfied_requirement
      open
      diffy

      Mike Dougherty (Gerrit)

      unread,
      1:11 PM (3 minutes ago) 1:11 PM
      to Louis Romero, Sylvain Defresne, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, ios-revie...@chromium.org, feature-me...@chromium.org, marq+...@chromium.org, ios-rev...@chromium.org, ios-r...@chromium.org
      Attention needed from Louis Romero

      Mike Dougherty added 1 comment

      File ios/web/public/web_state.h
      Line 346, Patchset 7 (Latest): // Returns the user agent override, or an empty string if none is set.
      Mike Dougherty . unresolved

      I think it would be better to use an std::optional<std::string> here instead of relying on an empty string. Would that work?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Louis Romero
      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: Id7827aa481960724cb331cb1693a2286b8567bd2
        Gerrit-Change-Number: 7675099
        Gerrit-PatchSet: 7
        Gerrit-Owner: Louis Romero <lpro...@google.com>
        Gerrit-Reviewer: Louis Romero <lpro...@google.com>
        Gerrit-Reviewer: Mike Dougherty <mich...@chromium.org>
        Gerrit-Reviewer: Sylvain Defresne <sdef...@chromium.org>
        Gerrit-Attention: Louis Romero <lpro...@google.com>
        Gerrit-Comment-Date: Mon, 23 Mar 2026 17:11:15 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages