[SG Android] Add Enterprise Proxy Service utilities [chromium/src : main]

0 views
Skip to first unread message

Zonghan Xu (Gerrit)

unread,
Jun 30, 2026, 12:39:38 PM (8 days ago) Jun 30
to Sebastien Lalancette, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Sebastien Lalancette

Zonghan Xu voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Sebastien Lalancette
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: I13250a084d3541951232f224bfd688df6b2a41ac
Gerrit-Change-Number: 7989012
Gerrit-PatchSet: 16
Gerrit-Owner: Zonghan Xu <xzon...@chromium.org>
Gerrit-Reviewer: Sebastien Lalancette <seblal...@chromium.org>
Gerrit-Reviewer: Zonghan Xu <xzon...@chromium.org>
Gerrit-Attention: Sebastien Lalancette <seblal...@chromium.org>
Gerrit-Comment-Date: Tue, 30 Jun 2026 16:39:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Sebastien Lalancette (Gerrit)

unread,
Jul 2, 2026, 3:57:20 PM (6 days ago) Jul 2
to Zonghan Xu, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org
Attention needed from Zonghan Xu

Sebastien Lalancette added 7 comments

File components/enterprise/net/core/types.h
Line 173, Patchset 18 (Latest): std::vector<std::string> subnets;
Sebastien Lalancette . unresolved

Are there no better types in `net` for this? Ideally, `ProvisioningDomainProxyConfig` should hold processed data rather than raw data as much as possible.

Line 142, Patchset 18 (Latest): std::string identity;
std::string protocol;
std::string proxy;
Sebastien Lalancette . unresolved

Can we add comments to better define what each of these are? Kind of odd to see a `proxy` field in a `Proxy` struct.

Line 140, Patchset 18 (Latest): // ID of a proxy, this should be unique within a
// `ProvisioningDomainProxyConfig`.
Sebastien Lalancette . unresolved

Why not enforce this via a map?

Line 84, Patchset 18 (Latest): struct ChromeConfig {
Sebastien Lalancette . unresolved

Could we get rid of `ChromeConfig` and just put the values as optional directly in the `Proxy` struct?

Line 69, Patchset 18 (Latest): std::vector<ProxyExtraHeader> extra_headers;
Sebastien Lalancette . unresolved

Wouldn't a map be better? It would also guarantee uniqueness of keys.

Line 68, Patchset 18 (Latest): ProxyAuthConfig auth_config;
Sebastien Lalancette . unresolved
```suggestion
std::optional<ProxyAuthConfig> auth_config;
```
Line 19, Patchset 18 (Latest): kNone,
Sebastien Lalancette . unresolved

Set first values to = 0 like in:
https://google.github.io/styleguide/cppguide.html#Enumerator_Names

In other enums too.

Open in Gerrit

Related details

Attention is currently required from:
  • Zonghan Xu
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: I13250a084d3541951232f224bfd688df6b2a41ac
    Gerrit-Change-Number: 7989012
    Gerrit-PatchSet: 18
    Gerrit-Owner: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Reviewer: Sebastien Lalancette <seblal...@chromium.org>
    Gerrit-Reviewer: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Attention: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Jul 2026 19:57:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zonghan Xu (Gerrit)

    unread,
    Jul 2, 2026, 5:33:01 PM (6 days ago) Jul 2
    to Sebastien Lalancette, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org
    Attention needed from Sebastien Lalancette

    Zonghan Xu added 7 comments

    File components/enterprise/net/core/types.h
    Line 173, Patchset 18: std::vector<std::string> subnets;
    Sebastien Lalancette . unresolved

    Are there no better types in `net` for this? Ideally, `ProvisioningDomainProxyConfig` should hold processed data rather than raw data as much as possible.

    Zonghan Xu

    We are converting these to `net::ProxyHostMatchingRules` later and sending them to the network stack, and `net::ProxyHostMatchingRules` takes string values.

    However, I made this conversion just happen early here and we can directly use `net::ProxyHostMatchingRules`

    PTAL

    Line 142, Patchset 18: std::string identity;

    std::string protocol;
    std::string proxy;
    Sebastien Lalancette . resolved

    Can we add comments to better define what each of these are? Kind of odd to see a `proxy` field in a `Proxy` struct.

    Zonghan Xu

    Done, on top of the comments, since we switched to using a map (where `identity` is the key), I renamed this struct from plain `Proxy` to `ProxyEndpoint` (since it's now a bunch of identification and auth/protocol information about proxies.

    Line 140, Patchset 18: // ID of a proxy, this should be unique within a
    // `ProvisioningDomainProxyConfig`.
    Sebastien Lalancette . resolved

    Why not enforce this via a map?

    Zonghan Xu

    Done

    Line 84, Patchset 18: struct ChromeConfig {
    Sebastien Lalancette . resolved

    Could we get rid of `ChromeConfig` and just put the values as optional directly in the `Proxy` struct?

    Zonghan Xu

    Done

    Line 69, Patchset 18: std::vector<ProxyExtraHeader> extra_headers;
    Sebastien Lalancette . resolved

    Wouldn't a map be better? It would also guarantee uniqueness of keys.

    Zonghan Xu

    Done

    Line 68, Patchset 18: ProxyAuthConfig auth_config;
    Sebastien Lalancette . resolved
    ```suggestion
    std::optional<ProxyAuthConfig> auth_config;
    ```
    Zonghan Xu

    Done

    Line 19, Patchset 18: kNone,
    Sebastien Lalancette . resolved

    Set first values to = 0 like in:
    https://google.github.io/styleguide/cppguide.html#Enumerator_Names

    In other enums too.

    Zonghan Xu

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sebastien Lalancette
    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: I13250a084d3541951232f224bfd688df6b2a41ac
    Gerrit-Change-Number: 7989012
    Gerrit-PatchSet: 19
    Gerrit-Owner: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Reviewer: Sebastien Lalancette <seblal...@chromium.org>
    Gerrit-Reviewer: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Attention: Sebastien Lalancette <seblal...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Jul 2026 21:32:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Sebastien Lalancette <seblal...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Zonghan Xu (Gerrit)

    unread,
    Jul 3, 2026, 3:33:39 PM (5 days ago) Jul 3
    to Sebastien Lalancette, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org
    Attention needed from Sebastien Lalancette

    Zonghan Xu voted Auto-Submit+1

    Auto-Submit+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sebastien Lalancette
    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: I13250a084d3541951232f224bfd688df6b2a41ac
    Gerrit-Change-Number: 7989012
    Gerrit-PatchSet: 20
    Gerrit-Owner: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Reviewer: Sebastien Lalancette <seblal...@chromium.org>
    Gerrit-Reviewer: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Attention: Sebastien Lalancette <seblal...@chromium.org>
    Gerrit-Comment-Date: Fri, 03 Jul 2026 19:33:32 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sebastien Lalancette (Gerrit)

    unread,
    9:44 AM (1 hour ago) 9:44 AM
    to Zonghan Xu, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org
    Attention needed from Zonghan Xu

    Sebastien Lalancette added 6 comments

    File components/enterprise/net/core/types.h
    Line 122, Patchset 22 (Latest): // The protocol scheme of the proxy server (e.g., "https").
    std::string protocol;
    // The URI of the proxy server (e.g., "proxy.example.com:443").
    std::string proxy_uri;
    Sebastien Lalancette . unresolved

    Do we need to keep them separate? Why not combine into a GURL?

    Line 69, Patchset 22 (Latest): std::vector<ProxyExtraHeader> extra_headers;
    Sebastien Lalancette . unresolved

    Why are we using ProxyExtraHeader here, but ExtraHeader (which wraps ProxyExtraHeader) in the ProxyConfig? Aren't both supposed to be the same?

    Line 149, Patchset 19: // A list of proxy identifiers.
    Sebastien Lalancette . unresolved

    Are they really identifiers, or is this supposed to be the ProxyList that a matching request should use? Like:
    https://source.chromium.org/chromium/chromium/src/+/main:net/proxy_resolution/proxy_config.h;l=214;drc=59cc65f624db22d4fc4e61f646a0a721e9e78b26;bpv=0;bpt=1

    Line 173, Patchset 18: std::vector<std::string> subnets;
    Sebastien Lalancette . resolved

    Are there no better types in `net` for this? Ideally, `ProvisioningDomainProxyConfig` should hold processed data rather than raw data as much as possible.

    Zonghan Xu

    We are converting these to `net::ProxyHostMatchingRules` later and sending them to the network stack, and `net::ProxyHostMatchingRules` takes string values.

    However, I made this conversion just happen early here and we can directly use `net::ProxyHostMatchingRules`

    PTAL

    Sebastien Lalancette

    Works with me.

    File components/enterprise/net/core/utils_unittest.cc
    Line 47, Patchset 22 (Latest):const char kValidPvdJsonResponse[] = R"({
    Sebastien Lalancette . unresolved

    Can you cover additional test cases to capture what we expect our parsing to do?

    e.g. all possible protocols, invalid/unsupported protocol, no auth config, no extra headers, etc.

    Line 53, Patchset 22 (Latest): "proxy": "https://proxy1.example.com",
    Sebastien Lalancette . unresolved

    For "https-connect" protocol, I don't believe the scheme is part of this field, but the port is.


    ```suggestion
    "proxy": "proxy1.example.com:443",
    ```

    That is defined in Table 2 of section 3.1.
    https://datatracker.ietf.org/doc/draft-ietf-intarea-proxy-config

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Zonghan Xu
    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: I13250a084d3541951232f224bfd688df6b2a41ac
    Gerrit-Change-Number: 7989012
    Gerrit-PatchSet: 22
    Gerrit-Owner: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Reviewer: Sebastien Lalancette <seblal...@chromium.org>
    Gerrit-Reviewer: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Attention: Zonghan Xu <xzon...@chromium.org>
    Gerrit-Comment-Date: Wed, 08 Jul 2026 13:44:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Sebastien Lalancette <seblal...@chromium.org>
    Comment-In-Reply-To: Zonghan Xu <xzon...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages