Add support for not-allowed hints in AcceptCHFrameInterceptor [chromium/src : main]

0 views
Skip to first unread message

Victor Tan (Gerrit)

unread,
Sep 2, 2025, 1:14:09 PM (6 days ago) Sep 2
to Yoshisato Yanagisawa, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
Attention needed from Yoshisato Yanagisawa

Victor Tan added 5 comments

Commit Message
Line 7, Patchset 7 (Latest):Add support for not-allowed hints in AcceptCHFrameInterceptor
Victor Tan . unresolved

starting M139 we saw the `ClientHints.AcceptCHFrame` drop significantly, it would be better understand the reason before we turn on related feature in stable.

File content/browser/client_hints/client_hints.cc
Line 1087, Patchset 7 (Latest): enabled_client_hints.not_allowed_hints.push_back(hint);
Victor Tan . unresolved

It would cause confused for people about this two variables meaning, could you please document/comment the actually meaning of `enabled_client_hints.hints` and `enabled_client_hints.not_allowed_hints`

based on your current logic:

  • `enabled_client_hints.hints` is allowed and enabled client hints.
  • `enabled_client_hints.not_allowed_hints` is not allowed client hints

am i understanding correctly? if so, can we just use the `if` instead of `else if`?

File content/browser/client_hints/client_hints_unittest.cc
Line 348, Patchset 7 (Latest): EXPECT_TRUE(actual_hints.not_allowed_hints.empty());
Victor Tan . unresolved

can you add a positive tests case that not_allowed_hints actually has something?

File services/network/accept_ch_frame_interceptor.cc
Line 170, Patchset 7 (Latest): if (!std::all_of(
Victor Tan . unresolved

as the lambda function because complex, I don't think it's easy to review. could you refactor it to a separate function? or add documents what it does.

File services/network/public/mojom/url_request.mojom
Line 57, Patchset 7 (Latest): array<WebClientHintsType> not_allowed_hints;
Victor Tan . unresolved

please document the difference between hints and not_allowed_hints, what actually are they?

Open in Gerrit

Related details

Attention is currently required from:
  • Yoshisato Yanagisawa
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: I502ed1f4b96746da009af0f55200a8757716cdd3
Gerrit-Change-Number: 6894100
Gerrit-PatchSet: 7
Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Mike Taylor <mike...@chromium.org>
Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Comment-Date: Tue, 02 Sep 2025 17:14:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoshisato Yanagisawa (Gerrit)

unread,
Sep 3, 2025, 12:15:08 AM (6 days ago) Sep 3
to Chromium Metrics Reviews, AyeAye, Victor Tan, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
Attention needed from Victor Tan

Yoshisato Yanagisawa added 5 comments

Commit Message
Line 7, Patchset 7:Add support for not-allowed hints in AcceptCHFrameInterceptor
Victor Tan . unresolved

starting M139 we saw the `ClientHints.AcceptCHFrame` drop significantly, it would be better understand the reason before we turn on related feature in stable.

Yoshisato Yanagisawa
It might be tracked with crbug.com/442599247, right?

I set up an internal chat thread to discuss that with the network experts, and let me continue the discussion there.

In the meantime, I'd like to proceed with this CL as the changes here are self-contained. I will make sure to CC you on any related follow-ups, especially the Finch config GCL, to ensure you're in the loop on its path to stable.

File content/browser/client_hints/client_hints.cc
Line 1087, Patchset 7: enabled_client_hints.not_allowed_hints.push_back(hint);
Victor Tan . resolved

It would cause confused for people about this two variables meaning, could you please document/comment the actually meaning of `enabled_client_hints.hints` and `enabled_client_hints.not_allowed_hints`

based on your current logic:

  • `enabled_client_hints.hints` is allowed and enabled client hints.
  • `enabled_client_hints.not_allowed_hints` is not allowed client hints

am i understanding correctly? if so, can we just use the `if` instead of `else if`?

Yoshisato Yanagisawa

Exactly. I have revised the code like so.

File content/browser/client_hints/client_hints_unittest.cc
Line 348, Patchset 7: EXPECT_TRUE(actual_hints.not_allowed_hints.empty());
Victor Tan . resolved

can you add a positive tests case that not_allowed_hints actually has something?

Yoshisato Yanagisawa

Done
The new test has been added for that purpose.

File services/network/accept_ch_frame_interceptor.cc
Line 170, Patchset 7: if (!std::all_of(
Victor Tan . unresolved

as the lambda function because complex, I don't think it's easy to review. could you refactor it to a separate function? or add documents what it does.

Yoshisato Yanagisawa

Good point. I agree that the lambda function has grown a bit too complex. It was simpler initially, but with more logic added, it became hard to review.

To improve readability, I've refactored it from using `std::all_of` to a standard `for` loop, which makes the logic more explicit.

What do you think of this approach?

File services/network/public/mojom/url_request.mojom
Line 57, Patchset 7: array<WebClientHintsType> not_allowed_hints;
Victor Tan . resolved

please document the difference between hints and not_allowed_hints, what actually are they?

Yoshisato Yanagisawa

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Victor Tan
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: I502ed1f4b96746da009af0f55200a8757716cdd3
Gerrit-Change-Number: 6894100
Gerrit-PatchSet: 8
Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Mike Taylor <mike...@chromium.org>
Gerrit-Attention: Victor Tan <vict...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Sep 2025 04:14:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Victor Tan <vict...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Victor Tan (Gerrit)

unread,
Sep 3, 2025, 11:21:03 AM (5 days ago) Sep 3
to Yoshisato Yanagisawa, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
Attention needed from Yoshisato Yanagisawa

Victor Tan voted and added 3 comments

Votes added by Victor Tan

Code-Review+1

3 comments

Commit Message
Line 7, Patchset 7:Add support for not-allowed hints in AcceptCHFrameInterceptor
Victor Tan . resolved

starting M139 we saw the `ClientHints.AcceptCHFrame` drop significantly, it would be better understand the reason before we turn on related feature in stable.

Yoshisato Yanagisawa
It might be tracked with crbug.com/442599247, right?

I set up an internal chat thread to discuss that with the network experts, and let me continue the discussion there.

In the meantime, I'd like to proceed with this CL as the changes here are self-contained. I will make sure to CC you on any related follow-ups, especially the Finch config GCL, to ensure you're in the loop on its path to stable.

Victor Tan

one concern is that if the metrics keeps drops, you would get mixed signal about your offload mechanism experiment. I'm fine to land this changes.

File services/network/accept_ch_frame_interceptor.cc
Line 170, Patchset 7: if (!std::all_of(
Victor Tan . unresolved

as the lambda function because complex, I don't think it's easy to review. could you refactor it to a separate function? or add documents what it does.

Yoshisato Yanagisawa

Good point. I agree that the lambda function has grown a bit too complex. It was simpler initially, but with more logic added, it became hard to review.

To improve readability, I've refactored it from using `std::all_of` to a standard `for` loop, which makes the logic more explicit.

What do you think of this approach?

Victor Tan

either works for me, feel free to add some comments.

Line 182, Patchset 8 (Latest): "Net.AcceptCHFrameInterceptor.MismatchClientHint", h);
Victor Tan . unresolved

1) if that's the case, do we need to update the document for `Net.AcceptCHFrameInterceptor.MismatchClientHint` since this patch changes the meaning of the metric? after your enabling `kAcceptCHFrameOffloadNotAllowedHints`: a hint to be valid for offloading if it is in either the allowed hints list (hints) or the new not_allowed_hints list.

2) also, people might feel confused about the `hint_enabled` variable, do you mean `is_valid_for_offload`?

3) `is_in_not_allowed_hints && !is_in_hints` , does `!is_in_hints` check is necessary?

Open in Gerrit

Related details

Attention is currently required from:
  • Yoshisato Yanagisawa
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: I502ed1f4b96746da009af0f55200a8757716cdd3
    Gerrit-Change-Number: 6894100
    Gerrit-PatchSet: 8
    Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Mike Taylor <mike...@chromium.org>
    Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-Comment-Date: Wed, 03 Sep 2025 15:20:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Yoshisato Yanagisawa <yyana...@chromium.org>
    Comment-In-Reply-To: Victor Tan <vict...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoshisato Yanagisawa (Gerrit)

    unread,
    Sep 3, 2025, 10:04:41 PM (5 days ago) Sep 3
    to Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org

    Yoshisato Yanagisawa added 2 comments

    File services/network/accept_ch_frame_interceptor.cc
    Line 170, Patchset 7: if (!std::all_of(
    Victor Tan . resolved

    as the lambda function because complex, I don't think it's easy to review. could you refactor it to a separate function? or add documents what it does.

    Yoshisato Yanagisawa

    Good point. I agree that the lambda function has grown a bit too complex. It was simpler initially, but with more logic added, it became hard to review.

    To improve readability, I've refactored it from using `std::all_of` to a standard `for` loop, which makes the logic more explicit.

    What do you think of this approach?

    Victor Tan

    either works for me, feel free to add some comments.

    Yoshisato Yanagisawa

    Done

    Line 182, Patchset 8: "Net.AcceptCHFrameInterceptor.MismatchClientHint", h);
    Victor Tan . resolved

    1) if that's the case, do we need to update the document for `Net.AcceptCHFrameInterceptor.MismatchClientHint` since this patch changes the meaning of the metric? after your enabling `kAcceptCHFrameOffloadNotAllowedHints`: a hint to be valid for offloading if it is in either the allowed hints list (hints) or the new not_allowed_hints list.

    2) also, people might feel confused about the `hint_enabled` variable, do you mean `is_valid_for_offload`?

    3) `is_in_not_allowed_hints && !is_in_hints` , does `!is_in_hints` check is necessary?

    Yoshisato Yanagisawa

    1) done.
    Updated the histograms.xml and updated the metric name because its meaning has slightly changed.

    2) done.
    3) `!is_in_hints` is necessary. This clarifies the hints that would cause the browser IPC without the new feature param.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I502ed1f4b96746da009af0f55200a8757716cdd3
    Gerrit-Change-Number: 6894100
    Gerrit-PatchSet: 9
    Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Mike Taylor <mike...@chromium.org>
    Gerrit-Comment-Date: Thu, 04 Sep 2025 02:04:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    gwsq (Gerrit)

    unread,
    Sep 3, 2025, 10:10:24 PM (5 days ago) Sep 3
    to Yoshisato Yanagisawa, Chromium IPC Reviews, Takashi Toyoshima, Kenichi Ishibashi, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
    Attention needed from Takashi Toyoshima

    Message from gwsq

    From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
    IPC: toyo...@chromium.org

    📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

    IPC reviewer(s): toyo...@chromium.org

    Note: IPC gwsq added no new reviewers; existing reviewers satisfied requirements!

    Reviewer source(s):
    toyo...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Takashi Toyoshima
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I502ed1f4b96746da009af0f55200a8757716cdd3
    Gerrit-Change-Number: 6894100
    Gerrit-PatchSet: 10
    Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Kenichi Ishibashi <ba...@chromium.org>
    Gerrit-CC: Mike Taylor <mike...@chromium.org>
    Gerrit-CC: gwsq
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Comment-Date: Thu, 04 Sep 2025 02:09:49 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Toyoshima (Gerrit)

    unread,
    Sep 4, 2025, 5:15:15 AM (4 days ago) Sep 4
    to Yoshisato Yanagisawa, Chromium IPC Reviews, Kenichi Ishibashi, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
    Attention needed from Yoshisato Yanagisawa

    Takashi Toyoshima added 2 comments

    File services/network/accept_ch_frame_interceptor.cc
    Line 181, Patchset 12 (Latest): if (is_in_not_allowed_hints && !is_in_hints) {
    base::UmaHistogramEnumeration(
    "Net.AcceptCHFrameInterceptor.OffloadSuccessForNotAllowedHint", h);
    }
    Takashi Toyoshima . unresolved

    talked offline about this, but we may scan all hints for this metric, even after the early-return condition below.

    File services/network/accept_ch_frame_interceptor_unittest.cc
    Line 209, Patchset 12 (Latest): const GURL kUrl("https://a.com");
    Takashi Toyoshima . unresolved

    Can we use example.com, or other standardized testing domain name?

    https://blog.jxck.io/entries/2017-09-27/example-local-test-domains.html

    Same for another test below, and also for other existing tests in this file.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yoshisato Yanagisawa
    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: I502ed1f4b96746da009af0f55200a8757716cdd3
      Gerrit-Change-Number: 6894100
      Gerrit-PatchSet: 12
      Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Kenichi Ishibashi <ba...@chromium.org>
      Gerrit-CC: Mike Taylor <mike...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-Comment-Date: Thu, 04 Sep 2025 09:14:43 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yoshisato Yanagisawa (Gerrit)

      unread,
      Sep 4, 2025, 5:30:09 AM (4 days ago) Sep 4
      to Chromium IPC Reviews, Takashi Toyoshima, Kenichi Ishibashi, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
      Attention needed from Takashi Toyoshima

      Yoshisato Yanagisawa voted and added 2 comments

      Votes added by Yoshisato Yanagisawa

      Commit-Queue+1

      2 comments

      File services/network/accept_ch_frame_interceptor.cc
      Line 181, Patchset 12: if (is_in_not_allowed_hints && !is_in_hints) {

      base::UmaHistogramEnumeration(
      "Net.AcceptCHFrameInterceptor.OffloadSuccessForNotAllowedHint", h);
      }
      Takashi Toyoshima . resolved

      talked offline about this, but we may scan all hints for this metric, even after the early-return condition below.

      Yoshisato Yanagisawa

      Yes. Updated the code to record all hints.

      File services/network/accept_ch_frame_interceptor_unittest.cc
      Line 209, Patchset 12: const GURL kUrl("https://a.com");
      Takashi Toyoshima . resolved

      Can we use example.com, or other standardized testing domain name?

      https://blog.jxck.io/entries/2017-09-27/example-local-test-domains.html

      Same for another test below, and also for other existing tests in this file.

      Yoshisato Yanagisawa

      Done
      I have also updated services/network/public/cpp/url_request_mojom_traits_unittest.cc.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Takashi Toyoshima
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: I502ed1f4b96746da009af0f55200a8757716cdd3
      Gerrit-Change-Number: 6894100
      Gerrit-PatchSet: 14
      Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Kenichi Ishibashi <ba...@chromium.org>
      Gerrit-CC: Mike Taylor <mike...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Comment-Date: Thu, 04 Sep 2025 09:29:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Takashi Toyoshima (Gerrit)

      unread,
      Sep 5, 2025, 2:56:42 AM (3 days ago) Sep 5
      to Yoshisato Yanagisawa, Chromium IPC Reviews, Kenichi Ishibashi, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
      Attention needed from Yoshisato Yanagisawa

      Takashi Toyoshima voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Yoshisato Yanagisawa
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: I502ed1f4b96746da009af0f55200a8757716cdd3
      Gerrit-Change-Number: 6894100
      Gerrit-PatchSet: 14
      Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Kenichi Ishibashi <ba...@chromium.org>
      Gerrit-CC: Mike Taylor <mike...@chromium.org>
      Gerrit-CC: gwsq
      Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-Comment-Date: Fri, 05 Sep 2025 06:56:08 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Kenichi Ishibashi (Gerrit)

      unread,
      Sep 5, 2025, 3:06:04 AM (3 days ago) Sep 5
      to Yoshisato Yanagisawa, Takashi Toyoshima, Chromium IPC Reviews, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
      Attention needed from Yoshisato Yanagisawa

      Kenichi Ishibashi voted and added 2 comments

      Votes added by Kenichi Ishibashi

      Code-Review+1

      2 comments

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

      lgtm

      File services/network/accept_ch_frame_interceptor.cc
      Line 189, Patchset 14 (Latest): "Net.AcceptCHFrameInterceptor.MismatchClientHint2", h);
      Kenichi Ishibashi . unresolved

      nit: Can we break early here?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Yoshisato Yanagisawa
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I502ed1f4b96746da009af0f55200a8757716cdd3
        Gerrit-Change-Number: 6894100
        Gerrit-PatchSet: 14
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Mike Taylor <mike...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Comment-Date: Fri, 05 Sep 2025 07:05:37 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoshisato Yanagisawa (Gerrit)

        unread,
        Sep 5, 2025, 3:34:45 AM (3 days ago) Sep 5
        to Kenichi Ishibashi, Takashi Toyoshima, Chromium IPC Reviews, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
        Attention needed from Kenichi Ishibashi

        Yoshisato Yanagisawa added 1 comment

        File services/network/accept_ch_frame_interceptor.cc
        Line 189, Patchset 14 (Latest): "Net.AcceptCHFrameInterceptor.MismatchClientHint2", h);
        Kenichi Ishibashi . unresolved

        nit: Can we break early here?

        Yoshisato Yanagisawa

        Unfortunately, no.
        Upon https://chromium-review.googlesource.com/c/chromium/src/+/6894100/comment/93473c05_557c3e4e/, I have changed the logic to record all mismatched hints, and we cannot do early return for that.
        Since the number of hints are at most 30 (https://source.chromium.org/chromium/chromium/src/+/main:services/network/public/mojom/web_client_hints_types.mojom;l=65;drc=983f9254c5bb2c3333f26df50ed19b2d8ef0cda0), the loop may not be a large issue.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kenichi Ishibashi
        Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Comment-Date: Fri, 05 Sep 2025 07:34:20 +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 5, 2025, 3:41:49 AM (3 days ago) Sep 5
        to Yoshisato Yanagisawa, Takashi Toyoshima, Chromium IPC Reviews, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org
        Attention needed from Yoshisato Yanagisawa

        Kenichi Ishibashi added 1 comment

        File services/network/accept_ch_frame_interceptor.cc
        Line 189, Patchset 14 (Latest): "Net.AcceptCHFrameInterceptor.MismatchClientHint2", h);
        Kenichi Ishibashi . resolved

        nit: Can we break early here?

        Yoshisato Yanagisawa

        Unfortunately, no.
        Upon https://chromium-review.googlesource.com/c/chromium/src/+/6894100/comment/93473c05_557c3e4e/, I have changed the logic to record all mismatched hints, and we cannot do early return for that.
        Since the number of hints are at most 30 (https://source.chromium.org/chromium/chromium/src/+/main:services/network/public/mojom/web_client_hints_types.mojom;l=65;drc=983f9254c5bb2c3333f26df50ed19b2d8ef0cda0), the loop may not be a large issue.

        Kenichi Ishibashi

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Yoshisato Yanagisawa
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        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: I502ed1f4b96746da009af0f55200a8757716cdd3
        Gerrit-Change-Number: 6894100
        Gerrit-PatchSet: 14
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Mike Taylor <mike...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Comment-Date: Fri, 05 Sep 2025 07:41:22 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Yoshisato Yanagisawa <yyana...@chromium.org>
        Comment-In-Reply-To: Kenichi Ishibashi <ba...@chromium.org>
        satisfied_requirement
        open
        diffy

        Yoshisato Yanagisawa (Gerrit)

        unread,
        Sep 5, 2025, 3:49:51 AM (3 days ago) Sep 5
        to Kenichi Ishibashi, Takashi Toyoshima, Chromium IPC Reviews, Victor Tan, Chromium Metrics Reviews, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org

        Yoshisato Yanagisawa voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        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: I502ed1f4b96746da009af0f55200a8757716cdd3
        Gerrit-Change-Number: 6894100
        Gerrit-PatchSet: 14
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Mike Taylor <mike...@chromium.org>
        Gerrit-CC: gwsq
        Gerrit-Comment-Date: Fri, 05 Sep 2025 07:49:25 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Sep 5, 2025, 4:05:51 AM (3 days ago) Sep 5
        to Yoshisato Yanagisawa, Kenichi Ishibashi, Takashi Toyoshima, Chromium IPC Reviews, Victor Tan, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Mike Taylor, asvitkine...@chromium.org, net-r...@chromium.org, ipc-securi...@chromium.org, network-ser...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Add support for not-allowed hints in AcceptCHFrameInterceptor

        The Accept-CH offload mechanism was underperforming due to frequent,
        unnecessary fallbacks to the browser process. This occurred when hints
        in an Accept_CH frame did not match the `EnabledClientHints` in the
        `network::ResourceRequest::TrustedParams`. This mismatch triggered a
        fallback, but the browser process's `AreCriticalClientHintsMissing()`
        check would then return `false`, resulting in an `kOk` status. It brings
        needless roundtrips.

        The root cause was a logic discrepancy. The network service's check did
        not replicate the browser's logic, which considers persisted but
        not-currently-allowed hints (e.g., due to Feature Policy) as valid for
        this specific check. The network service incorrectly treated them as a
        mismatch.

        This change aligns the logic by making the network service aware of
        these "not-allowed" hints. The browser now sends a list of not-allowed
        hints in addition to allowed ones, and the `AcceptCHFrameInterceptor`
        checks both. This avoids the unnecessary round trip.

        This behavior is controlled by the
        `kAcceptCHFrameOffloadNotAllowedHints` parameter of the
        `kOffloadAcceptCHFrameCheck` feature.

        OBSOLETE_HISTOGRAM[Net.AcceptCHFrameInterceptor.MismatchClientHint]=Replaced by Net.AcceptCHFrameInterceptor.MismatchClientHint2
        Bug: 406407746, 441612852
        Change-Id: I502ed1f4b96746da009af0f55200a8757716cdd3
        Reviewed-by: Kenichi Ishibashi <ba...@chromium.org>
        Reviewed-by: Takashi Toyoshima <toyo...@chromium.org>
        Commit-Queue: Yoshisato Yanagisawa <yyana...@chromium.org>
        Reviewed-by: Victor Tan <vict...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1511364}
        Files:
        • M content/browser/client_hints/client_hints.cc
        • M content/browser/client_hints/client_hints_unittest.cc
        • M services/network/accept_ch_frame_interceptor.cc
        • M services/network/accept_ch_frame_interceptor_unittest.cc
        • M services/network/public/cpp/features.cc
        • M services/network/public/cpp/features.h
        • M services/network/public/cpp/resource_request.h
        • M services/network/public/cpp/url_request_mojom_traits.cc
        • M services/network/public/cpp/url_request_mojom_traits.h
        • M services/network/public/cpp/url_request_mojom_traits_unittest.cc
        • M services/network/public/mojom/url_request.mojom
        • M services/network/url_loader_unittest.cc
        • M tools/metrics/histograms/metadata/net/histograms.xml
        Change size: L
        Delta: 13 files changed, 278 insertions(+), 34 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Kenichi Ishibashi, +1 by Victor Tan, +1 by Takashi Toyoshima
        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: I502ed1f4b96746da009af0f55200a8757716cdd3
        Gerrit-Change-Number: 6894100
        Gerrit-PatchSet: 15
        Gerrit-Owner: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Victor Tan <vict...@chromium.org>
        Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages