NQE: make NQE::NotifyHeadersReceived async [chromium/src : main]

0 views
Skip to first unread message

Martin Pan-Verde (Gerrit)

unread,
Feb 10, 2026, 4:46:34 PM (11 days ago) Feb 10
to Keita Suzuki, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
Attention needed from Keita Suzuki

Martin Pan-Verde voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Keita Suzuki
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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
Gerrit-Change-Number: 7542003
Gerrit-PatchSet: 3
Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
Gerrit-Attention: Keita Suzuki <suzuk...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Feb 2026 21:46:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Keita Suzuki (Gerrit)

unread,
Feb 12, 2026, 4:59:29 AM (9 days ago) Feb 12
to Martin Pan-Verde, Yoichi Osato, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
Attention needed from Martin Pan-Verde

Keita Suzuki added 6 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Keita Suzuki . resolved

overall looks good logic wise. I would defer the review to the //net owners for other parts.

CC @yoi...@chromium.org as the implementer of the NotifyStartTransaction async. This experiment sort of works together especially the defer all steps option. Could you also take a look and see if this makes sense?

File net/nqe/network_quality_estimator.h
Line 668, Patchset 3 (Latest): std::unordered_map<raw_ptr<const URLRequest>, base::TimeTicks>
Keita Suzuki . unresolved

I think it would be fine to keep it as is, but we probably would want to combine the logic with `waiting_async_notify_start_transactions_` in the near future.
It might be good to leave a comment.

Line 482, Patchset 3 (Latest): // Notifies NetworkQualityEstimator that the response header of |request| has
Keita Suzuki . unresolved

nit: I think we use ` instead of | now.

File net/nqe/network_quality_estimator.cc
Line 546, Patchset 3 (Latest): if (base::FeatureList::IsEnabled(
kNetworkQualityEstimatorAsyncNotifyStartTransaction)) {
WaitNotifyStartTransactionDone(request);
}
if (base::FeatureList::IsEnabled(
kNetworkQualityEstimatorAsyncNotifyHeadersReceived)) {
WaitNotifyHeadersReceivedDone(request);
}
Keita Suzuki . unresolved

Could we split this into a different method / function so that we do not have to copy for each subsequent method?

Line 564, Patchset 3 (Latest): if (base::FeatureList::IsEnabled(
kNetworkQualityEstimatorAsyncNotifyStartTransaction)) {
WaitNotifyStartTransactionDone(request);
}
if (base::FeatureList::IsEnabled(
kNetworkQualityEstimatorAsyncNotifyHeadersReceived)) {
WaitNotifyHeadersReceivedDone(request);
}
Keita Suzuki . unresolved

ditto

Line 585, Patchset 3 (Latest): if (base::FeatureList::IsEnabled(
kNetworkQualityEstimatorAsyncNotifyStartTransaction)) {
WaitNotifyStartTransactionDone(request);
}
if (base::FeatureList::IsEnabled(
kNetworkQualityEstimatorAsyncNotifyHeadersReceived)) {
WaitNotifyHeadersReceivedDone(request);
}
Keita Suzuki . unresolved

ditto

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Pan-Verde
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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
    Gerrit-Change-Number: 7542003
    Gerrit-PatchSet: 3
    Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
    Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
    Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
    Gerrit-CC: Yoichi Osato <yoi...@chromium.org>
    Gerrit-Attention: Martin Pan-Verde <thes...@google.com>
    Gerrit-Comment-Date: Thu, 12 Feb 2026 09:59:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Martin Pan-Verde (Gerrit)

    unread,
    Feb 12, 2026, 11:41:08 AM (9 days ago) Feb 12
    to Yoichi Osato, Keita Suzuki, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
    Attention needed from Keita Suzuki

    Martin Pan-Verde added 5 comments

    File net/nqe/network_quality_estimator.h
    Line 668, Patchset 3: std::unordered_map<raw_ptr<const URLRequest>, base::TimeTicks>
    Keita Suzuki . resolved

    I think it would be fine to keep it as is, but we probably would want to combine the logic with `waiting_async_notify_start_transactions_` in the near future.
    It might be good to leave a comment.

    Martin Pan-Verde

    Done

    Line 482, Patchset 3: // Notifies NetworkQualityEstimator that the response header of |request| has
    Keita Suzuki . resolved

    nit: I think we use ` instead of | now.

    Martin Pan-Verde

    Done

    File net/nqe/network_quality_estimator.cc
    Line 546, Patchset 3: if (base::FeatureList::IsEnabled(

    kNetworkQualityEstimatorAsyncNotifyStartTransaction)) {
    WaitNotifyStartTransactionDone(request);
    }
    if (base::FeatureList::IsEnabled(
    kNetworkQualityEstimatorAsyncNotifyHeadersReceived)) {
    WaitNotifyHeadersReceivedDone(request);
    }
    Keita Suzuki . resolved

    Could we split this into a different method / function so that we do not have to copy for each subsequent method?

    Martin Pan-Verde

    Done

    Line 564, Patchset 3: if (base::FeatureList::IsEnabled(

    kNetworkQualityEstimatorAsyncNotifyStartTransaction)) {
    WaitNotifyStartTransactionDone(request);
    }
    if (base::FeatureList::IsEnabled(
    kNetworkQualityEstimatorAsyncNotifyHeadersReceived)) {
    WaitNotifyHeadersReceivedDone(request);
    }
    Keita Suzuki . resolved

    ditto

    Martin Pan-Verde

    Done

    Line 585, Patchset 3: if (base::FeatureList::IsEnabled(

    kNetworkQualityEstimatorAsyncNotifyStartTransaction)) {
    WaitNotifyStartTransactionDone(request);
    }
    if (base::FeatureList::IsEnabled(
    kNetworkQualityEstimatorAsyncNotifyHeadersReceived)) {
    WaitNotifyHeadersReceivedDone(request);
    }
    Keita Suzuki . resolved

    ditto

    Martin Pan-Verde

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keita Suzuki
    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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
      Gerrit-Change-Number: 7542003
      Gerrit-PatchSet: 4
      Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
      Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
      Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
      Gerrit-CC: Yoichi Osato <yoi...@chromium.org>
      Gerrit-Attention: Keita Suzuki <suzuk...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Feb 2026 16:41:04 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Keita Suzuki <suzuk...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Martin Pan-Verde (Gerrit)

      unread,
      Feb 12, 2026, 1:38:43 PM (9 days ago) Feb 12
      to Nidhi Jaju, Yoichi Osato, Keita Suzuki, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
      Attention needed from Keita Suzuki and Nidhi Jaju

      Martin Pan-Verde voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Keita Suzuki
      • Nidhi Jaju
      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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
      Gerrit-Change-Number: 7542003
      Gerrit-PatchSet: 4
      Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
      Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
      Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
      Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
      Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
      Gerrit-Attention: Keita Suzuki <suzuk...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Feb 2026 18:38:38 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yoichi Osato (Gerrit)

      unread,
      Feb 12, 2026, 9:04:03 PM (8 days ago) Feb 12
      to Martin Pan-Verde, Nidhi Jaju, Keita Suzuki, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
      Attention needed from Keita Suzuki, Martin Pan-Verde and Nidhi Jaju

      Yoichi Osato added 2 comments

      Patchset-level comments
      File-level comment, Patchset 4 (Latest):
      Yoichi Osato . resolved

      Since this is complex, it is good to add testing/variations/fieldtrial_testing_config.json testing here.

      File net/nqe/network_quality_estimator.cc
      Line 65, Patchset 4 (Latest): kDeferCurrentStep,
      Yoichi Osato . unresolved

      I'm not sure we need this kDeferCurrentStep flag, this makes code/experiment complex.
      I think we might just consider running current NotifyHeadersReceived() body including kNetworkQualityEstimatorAsyncNotifyStartTransaction guard as-is, async, or defer independently to NetworkQualityEstimatorAsyncNotifyStartTransaction feature.
      Then you don't need to care about the flag (and you can reuse my code?)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Keita Suzuki
      • Martin Pan-Verde
      • Nidhi Jaju
      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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
        Gerrit-Change-Number: 7542003
        Gerrit-PatchSet: 4
        Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
        Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
        Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
        Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
        Gerrit-CC: Yoichi Osato <yoi...@chromium.org>
        Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
        Gerrit-Attention: Keita Suzuki <suzuk...@chromium.org>
        Gerrit-Attention: Martin Pan-Verde <thes...@google.com>
        Gerrit-Comment-Date: Fri, 13 Feb 2026 02:03:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Nidhi Jaju (Gerrit)

        unread,
        Feb 13, 2026, 2:24:05 AM (8 days ago) Feb 13
        to Martin Pan-Verde, Yoichi Osato, Keita Suzuki, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
        Attention needed from Keita Suzuki and Martin Pan-Verde

        Nidhi Jaju added 4 comments

        Patchset-level comments
        Yoichi Osato . unresolved

        Since this is complex, it is good to add testing/variations/fieldtrial_testing_config.json testing here.

        Nidhi Jaju

        +1, or if it's possible to add tests for this new behavior that would be great too!

        File net/nqe/network_quality_estimator.h
        Line 498, Patchset 4 (Latest): // NotifyStartTransaction, then NotifyHeadersReceived.
        Nidhi Jaju . unresolved

        We should update this comment to say something similar to the above function comments, because we're not actually waiting for NotifyStartTransaction, then NotifyHeadersReceived. What the function actually does is immediately call NotifyStartTransactionInternal and NotifyHeadersReceivedInternal, if they haven't been called already.

        Line 106, Patchset 4 (Latest): // `params` contains the
        Nidhi Jaju . unresolved

        I love the cleanup, but would you mind separating this out into a separate CL as it makes it easier to review the changes specific to this feature?
        Similar to https://chromium.googlesource.com/chromium/src/+/HEAD/docs/cl_tips.md#separate-behavior-changes-from-refactoring.

        File net/nqe/network_quality_estimator.cc
        Yoichi Osato . unresolved

        I'm not sure we need this kDeferCurrentStep flag, this makes code/experiment complex.
        I think we might just consider running current NotifyHeadersReceived() body including kNetworkQualityEstimatorAsyncNotifyStartTransaction guard as-is, async, or defer independently to NetworkQualityEstimatorAsyncNotifyStartTransaction feature.
        Then you don't need to care about the flag (and you can reuse my code?)

        Nidhi Jaju

        +1, can you explain the value of experimenting with just deferring the previous step and running it offset by 1 event?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Keita Suzuki
        • Martin Pan-Verde
        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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
        Gerrit-Change-Number: 7542003
        Gerrit-PatchSet: 4
        Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
        Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
        Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
        Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
        Gerrit-CC: Yoichi Osato <yoi...@chromium.org>
        Gerrit-Attention: Keita Suzuki <suzuk...@chromium.org>
        Gerrit-Attention: Martin Pan-Verde <thes...@google.com>
        Gerrit-Comment-Date: Fri, 13 Feb 2026 07:23:37 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Yoichi Osato <yoi...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Martin Pan-Verde (Gerrit)

        unread,
        Feb 20, 2026, 6:30:45 PM (13 hours ago) Feb 20
        to Chromium Metrics Reviews, Code Review Nudger, Nidhi Jaju, Yoichi Osato, Keita Suzuki, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, android-web...@chromium.org, net-r...@chromium.org, tbansal+...@chromium.org
        Attention needed from Keita Suzuki, Nidhi Jaju and Yoichi Osato

        Martin Pan-Verde added 5 comments

        Patchset-level comments
        Yoichi Osato . unresolved

        Since this is complex, it is good to add testing/variations/fieldtrial_testing_config.json testing here.

        Nidhi Jaju

        +1, or if it's possible to add tests for this new behavior that would be great too!

        Martin Pan-Verde

        Removed some complexity and added the fieldtrial_testing_config.json and it uncovered test failures; rerunning CQ with the fix now...

        File net/nqe/network_quality_estimator.h
        Line 498, Patchset 4: // NotifyStartTransaction, then NotifyHeadersReceived.
        Nidhi Jaju . resolved

        We should update this comment to say something similar to the above function comments, because we're not actually waiting for NotifyStartTransaction, then NotifyHeadersReceived. What the function actually does is immediately call NotifyStartTransactionInternal and NotifyHeadersReceivedInternal, if they haven't been called already.

        Martin Pan-Verde

        Done

        Line 106, Patchset 4: // `params` contains the
        Nidhi Jaju . resolved

        I love the cleanup, but would you mind separating this out into a separate CL as it makes it easier to review the changes specific to this feature?
        Similar to https://chromium.googlesource.com/chromium/src/+/HEAD/docs/cl_tips.md#separate-behavior-changes-from-refactoring.

        File net/nqe/network_quality_estimator.cc
        Line 65, Patchset 4: kDeferCurrentStep,
        Yoichi Osato . unresolved

        I'm not sure we need this kDeferCurrentStep flag, this makes code/experiment complex.
        I think we might just consider running current NotifyHeadersReceived() body including kNetworkQualityEstimatorAsyncNotifyStartTransaction guard as-is, async, or defer independently to NetworkQualityEstimatorAsyncNotifyStartTransaction feature.
        Then you don't need to care about the flag (and you can reuse my code?)

        Nidhi Jaju

        +1, can you explain the value of experimenting with just deferring the previous step and running it offset by 1 event?

        Martin Pan-Verde

        I added it mainly out of curiosity, but you're right that it made the code more complex and likely won't make that much of a difference. Changed the feature to be similar to kNetworkQualityEstimatorAsyncNotifyStartTransaction.

        Line 1301, Patchset 6 (Latest): base::UmaHistogramLongTimes100(
        base::StrCat({"NQE.RTT.ObservationBufferLifeTime2.",
        CategoryToString(observation_category)}),
        delta);
        base::UmaHistogramLongTimes100("NQE.RTT.ObservationBufferLifeTime2.All",
        delta);
        Martin Pan-Verde . unresolved

        Adding the ability to add observations out of order could potentially change the deltas we see for these metrics - is that concerning? Or do you think it's fine as long as we pay attention to them during the experiment and fix if needed?

        @nidh...@chromium.org @yoi...@chromium.org

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Keita Suzuki
        • Nidhi Jaju
        • Yoichi Osato
        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: Ie2a5b28b438afca9a1c5958f36fe990cbd7cd67c
        Gerrit-Change-Number: 7542003
        Gerrit-PatchSet: 6
        Gerrit-Owner: Martin Pan-Verde <thes...@google.com>
        Gerrit-Reviewer: Keita Suzuki <suzuk...@chromium.org>
        Gerrit-Reviewer: Martin Pan-Verde <thes...@google.com>
        Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Yoichi Osato <yoi...@chromium.org>
        Gerrit-Attention: Yoichi Osato <yoi...@chromium.org>
        Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
        Gerrit-Attention: Keita Suzuki <suzuk...@chromium.org>
        Gerrit-Comment-Date: Fri, 20 Feb 2026 23:30:33 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Yoichi Osato <yoi...@chromium.org>
        Comment-In-Reply-To: Nidhi Jaju <nidh...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages