Add proxy delegation and retry info support to Win Proxy Service [chromium/src : main]

0 views
Skip to first unread message

Kenichi Ishibashi (Gerrit)

unread,
Sep 1, 2025, 9:46:22 PM (7 days ago) Sep 1
to Mayur Patil, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice and Mayur Patil

Kenichi Ishibashi added 6 comments

File net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
Line 98, Patchset 2 (Latest): const ProxyInfo& proxy_info) {
Kenichi Ishibashi . unresolved

nit: Add `DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);`

Line 104, Patchset 2 (Latest): if (proxy_delegate_) {
proxy_delegate_->OnSuccessfulRequestAfterFailures(new_retry_info);
}

for (const auto& iter : new_retry_info) {
auto existing = proxy_retry_info_.find(iter.first);
if (existing == proxy_retry_info_.end()) {
proxy_retry_info_[iter.first] = iter.second;
if (proxy_delegate_) {
const ProxyChain& bad_proxy = iter.first;
DCHECK(!bad_proxy.is_direct());
const ProxyRetryInfo& proxy_retry_info = iter.second;
proxy_delegate_->OnFallback(bad_proxy, proxy_retry_info.net_error);
}
} else if (existing->second.bad_until < iter.second.bad_until) {
existing->second.bad_until = iter.second.bad_until;
}
}
Kenichi Ishibashi . unresolved

These look a dup of ConfiguredProxyResolutionService::ReportSuccess(). I'd prefer to avoid duplication, but not sure how to avoid that.

One option is to factor out common parts to ProxyResolutionService and make it non-pure virtual. Another option might be adding ProxyResolutionServiceBase class that has the common parts.

Could you add a TODO to avoid duplication for now?

Line 184, Patchset 2 (Latest): proxy_delegate_->OnResolveProxy(url, network_anonymization_key, method,
Kenichi Ishibashi . unresolved

Can we have a test where a delegate modifies `result`?

File net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc
Line 106, Patchset 2 (Latest):class MockProxyDelegateForTesting : public ProxyDelegate {
Kenichi Ishibashi . unresolved
Line 174, Patchset 2 (Latest): int on_resolve_proxy_call_count_ = 0;
Kenichi Ishibashi . unresolved

nit: size_t for counters, ditto below.

File tools/metrics/histograms/metadata/net/histograms.xml
Line 3436, Patchset 2 (Latest): <owner>ri...@chromium.org</owner>
Kenichi Ishibashi . unresolved

ricea@: Are you fine with this?

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Mayur Patil
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
Gerrit-Change-Number: 6865691
Gerrit-PatchSet: 2
Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Adam Rice <ri...@chromium.org>
Gerrit-Attention: Mayur Patil <patil...@microsoft.com>
Gerrit-Comment-Date: Tue, 02 Sep 2025 01:45:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mayur Patil (Gerrit)

unread,
Sep 2, 2025, 7:06:09 AM (6 days ago) Sep 2
to Kenichi Ishibashi, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice and Kenichi Ishibashi

Mayur Patil added 5 comments

File net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
Line 98, Patchset 2: const ProxyInfo& proxy_info) {
Kenichi Ishibashi . resolved

nit: Add `DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);`

Mayur Patil

Done

Line 104, Patchset 2: if (proxy_delegate_) {

proxy_delegate_->OnSuccessfulRequestAfterFailures(new_retry_info);
}

for (const auto& iter : new_retry_info) {
auto existing = proxy_retry_info_.find(iter.first);
if (existing == proxy_retry_info_.end()) {
proxy_retry_info_[iter.first] = iter.second;
if (proxy_delegate_) {
const ProxyChain& bad_proxy = iter.first;
DCHECK(!bad_proxy.is_direct());
const ProxyRetryInfo& proxy_retry_info = iter.second;
proxy_delegate_->OnFallback(bad_proxy, proxy_retry_info.net_error);
}
} else if (existing->second.bad_until < iter.second.bad_until) {
existing->second.bad_until = iter.second.bad_until;
}
}
Kenichi Ishibashi . unresolved

These look a dup of ConfiguredProxyResolutionService::ReportSuccess(). I'd prefer to avoid duplication, but not sure how to avoid that.

One option is to factor out common parts to ProxyResolutionService and make it non-pure virtual. Another option might be adding ProxyResolutionServiceBase class that has the common parts.

Could you add a TODO to avoid duplication for now?

Mayur Patil

I’ve moved the common code into a static method for better reusability and clarity. I’d appreciate your thoughts on this approach.
Previously, ProxyResolutionService was designed as an interface, but I’ve now added a static method to it. While this change simplifies usage in some cases, I understand there are alternative options—such as moving the logic to an existing utility class or creating a new one.
I’d love to hear your perspective on this and whether you think a different structure might be more appropriate.
Thanks!

Line 184, Patchset 2: proxy_delegate_->OnResolveProxy(url, network_anonymization_key, method,
Kenichi Ishibashi . resolved

Can we have a test where a delegate modifies `result`?

Mayur Patil

Done

File net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc
Line 106, Patchset 2:class MockProxyDelegateForTesting : public ProxyDelegate {
Kenichi Ishibashi . resolved
Mayur Patil

Done

Line 174, Patchset 2: int on_resolve_proxy_call_count_ = 0;
Kenichi Ishibashi . resolved

nit: size_t for counters, ditto below.

Mayur Patil

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Kenichi Ishibashi
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
Gerrit-Change-Number: 6865691
Gerrit-PatchSet: 3
Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Adam Rice <ri...@chromium.org>
Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Comment-Date: Tue, 02 Sep 2025 11:05:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kenichi Ishibashi <ba...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kenichi Ishibashi (Gerrit)

unread,
Sep 4, 2025, 9:19:19 PM (4 days ago) Sep 4
to Mayur Patil, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice and Mayur Patil

Kenichi Ishibashi voted and added 2 comments

Votes added by Kenichi Ishibashi

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Kenichi Ishibashi . resolved

lgtm on my side. Thanks!

File net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
Line 104, Patchset 2: if (proxy_delegate_) {
proxy_delegate_->OnSuccessfulRequestAfterFailures(new_retry_info);
}

for (const auto& iter : new_retry_info) {
auto existing = proxy_retry_info_.find(iter.first);
if (existing == proxy_retry_info_.end()) {
proxy_retry_info_[iter.first] = iter.second;
if (proxy_delegate_) {
const ProxyChain& bad_proxy = iter.first;
DCHECK(!bad_proxy.is_direct());
const ProxyRetryInfo& proxy_retry_info = iter.second;
proxy_delegate_->OnFallback(bad_proxy, proxy_retry_info.net_error);
}
} else if (existing->second.bad_until < iter.second.bad_until) {
existing->second.bad_until = iter.second.bad_until;
}
}
Kenichi Ishibashi . resolved

These look a dup of ConfiguredProxyResolutionService::ReportSuccess(). I'd prefer to avoid duplication, but not sure how to avoid that.

One option is to factor out common parts to ProxyResolutionService and make it non-pure virtual. Another option might be adding ProxyResolutionServiceBase class that has the common parts.

Could you add a TODO to avoid duplication for now?

Mayur Patil

I’ve moved the common code into a static method for better reusability and clarity. I’d appreciate your thoughts on this approach.
Previously, ProxyResolutionService was designed as an interface, but I’ve now added a static method to it. While this change simplifies usage in some cases, I understand there are alternative options—such as moving the logic to an existing utility class or creating a new one.
I’d love to hear your perspective on this and whether you think a different structure might be more appropriate.
Thanks!

Kenichi Ishibashi

I suspect we may want to share more code and adding static methods every time might be a bit of work, but the current approach seems reasonable to me. Thank you for reducing duplication.

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Mayur Patil
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
Gerrit-Change-Number: 6865691
Gerrit-PatchSet: 5
Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Adam Rice <ri...@chromium.org>
Gerrit-Attention: Mayur Patil <patil...@microsoft.com>
Gerrit-Comment-Date: Fri, 05 Sep 2025 01:18:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Mayur Patil <patil...@microsoft.com>
Comment-In-Reply-To: Kenichi Ishibashi <ba...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kenichi Ishibashi (Gerrit)

unread,
Sep 5, 2025, 2:14:23 AM (4 days ago) Sep 5
to Mayur Patil, Hayato Ito, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice, Hayato Ito and Mayur Patil

Kenichi Ishibashi added 1 comment

Patchset-level comments
Kenichi Ishibashi . resolved

Adding hayato@ for review.

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Hayato Ito
  • Mayur Patil
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
Gerrit-Change-Number: 6865691
Gerrit-PatchSet: 5
Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Hayato Ito <hay...@chromium.org>
Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Hayato Ito <hay...@chromium.org>
Gerrit-Attention: Adam Rice <ri...@chromium.org>
Gerrit-Attention: Mayur Patil <patil...@microsoft.com>
Gerrit-Comment-Date: Fri, 05 Sep 2025 06:13:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mayur Patil (Gerrit)

unread,
Sep 5, 2025, 9:04:49 AM (3 days ago) Sep 5
to Hayato Ito, Kenichi Ishibashi, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice, Hayato Ito and Kenichi Ishibashi

Mayur Patil added 1 comment

File tools/metrics/histograms/metadata/net/histograms.xml
Kenichi Ishibashi . unresolved

ricea@: Are you fine with this?

Mayur Patil

@ri...@chromium.org

Is this fine to add you as the owner of histogram

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Hayato Ito
  • Kenichi Ishibashi
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
Gerrit-Change-Number: 6865691
Gerrit-PatchSet: 5
Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Hayato Ito <hay...@chromium.org>
Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Attention: Hayato Ito <hay...@chromium.org>
Gerrit-Attention: Adam Rice <ri...@chromium.org>
Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
Gerrit-Comment-Date: Fri, 05 Sep 2025 13:04:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kenichi Ishibashi <ba...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Hayato Ito (Gerrit)

unread,
5:37 AM (12 hours ago) 5:37 AM
to Mayur Patil, Kenichi Ishibashi, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
Attention needed from Adam Rice and Mayur Patil

Hayato Ito voted and added 3 comments

Votes added by Hayato Ito

Code-Review+1

3 comments

Patchset-level comments
Hayato Ito . resolved

LGTM % nits.

Thank you for working on this. It addresses several TODOs. Nice work!

File net/proxy_resolution/win/windows_system_proxy_resolution_service.h
Line 109, Patchset 5 (Latest): raw_ptr<ProxyDelegate> proxy_delegate_ = nullptr;
Hayato Ito . unresolved

Nit: For consistency within this header, could you please add a comment explaining what this is used for?

File net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc
Line 420, Patchset 5 (Latest): TestProxyDelegate proxy_delegate;
Hayato Ito . unresolved

nit; Could you please clarify why `TestProxyDelegate` is set up in the `ReportSuccessWithRetryInfo` test? It seems the only difference between this test and `ReportSuccessWithoutDelegate` is the presence of `TestProxyDelegate`. I'm guessing this is to ensure both major code paths are tested, but I would appreciate it if you could add a brief comment to clarify the purpose of these tests. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
  • Mayur Patil
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
    Gerrit-Change-Number: 6865691
    Gerrit-PatchSet: 5
    Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Hayato Ito <hay...@chromium.org>
    Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
    Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-Attention: Adam Rice <ri...@chromium.org>
    Gerrit-Attention: Mayur Patil <patil...@microsoft.com>
    Gerrit-Comment-Date: Mon, 08 Sep 2025 09:37:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mayur Patil (Gerrit)

    unread,
    1:35 PM (4 hours ago) 1:35 PM
    to Hayato Ito, Kenichi Ishibashi, Adam Rice, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, edgen...@microsoft.com, asvitkine...@chromium.org, net-r...@chromium.org, network-ser...@chromium.org
    Attention needed from Adam Rice, Hayato Ito and Kenichi Ishibashi

    Mayur Patil added 2 comments

    File net/proxy_resolution/win/windows_system_proxy_resolution_service.h
    Line 109, Patchset 5: raw_ptr<ProxyDelegate> proxy_delegate_ = nullptr;
    Hayato Ito . resolved

    Nit: For consistency within this header, could you please add a comment explaining what this is used for?

    Mayur Patil

    done

    File net/proxy_resolution/win/windows_system_proxy_resolution_service_unittest.cc
    Line 420, Patchset 5: TestProxyDelegate proxy_delegate;
    Hayato Ito . resolved

    nit; Could you please clarify why `TestProxyDelegate` is set up in the `ReportSuccessWithRetryInfo` test? It seems the only difference between this test and `ReportSuccessWithoutDelegate` is the presence of `TestProxyDelegate`. I'm guessing this is to ensure both major code paths are tested, but I would appreciate it if you could add a brief comment to clarify the purpose of these tests. Thanks!

    Mayur Patil

    The ReportSuccessWithRetryInfo test was implemented to validate basic proxy retry functionality.

    Additionally, the method previously named ReportSuccessWithoutDelegate (now renamed for clarity) was introduced to cover a specific condition in the ProcessProxyRetryInfo method. This condition involves iterating over the retry map while intentionally bypassing the proxy_delegate code section.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adam Rice
    • Hayato Ito
    • Kenichi Ishibashi
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I28cc218fcb1d6b59f40e692b8320dd4fbdad56cd
      Gerrit-Change-Number: 6865691
      Gerrit-PatchSet: 6
      Gerrit-Owner: Mayur Patil <patil...@microsoft.com>
      Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
      Gerrit-Reviewer: Hayato Ito <hay...@chromium.org>
      Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
      Gerrit-Reviewer: Mayur Patil <patil...@microsoft.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-Attention: Hayato Ito <hay...@chromium.org>
      Gerrit-Attention: Adam Rice <ri...@chromium.org>
      Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
      Gerrit-Comment-Date: Mon, 08 Sep 2025 17:35:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Hayato Ito <hay...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages