Use SimpleURLLoader::DownloadHeadersOnly in components/metrics [chromium/src : main]

0 views
Skip to first unread message

Andrew Williams (Gerrit)

unread,
Dec 17, 2025, 2:55:03 PM (3 days ago) Dec 17
to chromium...@chromium.org, net-r...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com

Andrew Williams has uploaded the change for review

Commit message

Use SimpleURLLoader::DownloadHeadersOnly in components/metrics

This change replaces calls to SimpleURLLoader's
DownloadToStringOfUnboundedSizeUntilCrashAndDie with DownloadHeadersOnly
in various parts of the Chrome codebase. The body of the response was
not being used in these instances, so having SimpleURLLoader not store
the response body is more efficient and better conveys how the callers
interact with the request responses.

No major changes in functionality are expected as a result of this other
than SimpleURLLoader no longer saving the response bodies while the
request is being downloaded.

This CL was uploaded by git cl split.
Bug: None
Change-Id: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490

Change diff


Change information

Files:
  • M components/metrics/net/net_metrics_log_uploader.cc
  • M components/metrics/net/net_metrics_log_uploader.h
Change size: S
Delta: 2 files changed, 10 insertions(+), 7 deletions(-)
Open in Gerrit

Related details

Attention set is empty
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: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
Gerrit-Change-Number: 7270689
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Williams <awi...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Williams (Gerrit)

unread,
Dec 17, 2025, 4:26:25 PM (3 days ago) Dec 17
to Chromium Metrics Reviews, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, net-r...@chromium.org

Andrew Williams voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
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: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
Gerrit-Change-Number: 7270689
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-Comment-Date: Wed, 17 Dec 2025 21:26:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

gwsq (Gerrit)

unread,
Dec 17, 2025, 4:27:28 PM (3 days ago) Dec 17
to Andrew Williams, Chromium Metrics Reviews, Mark Pearson, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, net-r...@chromium.org
Attention needed from Mark Pearson

Message from gwsq

Reviewer source(s):
mpea...@chromium.org is from context(analysis/uma/chrome-metrics.gwsq)

Open in Gerrit

Related details

Attention is currently required from:
  • Mark Pearson
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: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
Gerrit-Change-Number: 7270689
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Mark Pearson <mpea...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: gwsq
Gerrit-Attention: Mark Pearson <mpea...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Dec 2025 21:27:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Williams (Gerrit)

unread,
Dec 17, 2025, 4:30:59 PM (3 days ago) Dec 17
to Chromium Metrics Reviews, Mark Pearson, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, net-r...@chromium.org
Attention needed from Mark Pearson

Andrew Williams added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Andrew Williams . resolved

Note that this was also reviewed via https://chromium-review.googlesource.com/c/chromium/src/+/7266460, but split out here for owners approval

Gerrit-Comment-Date: Wed, 17 Dec 2025 21:30:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mark Pearson (Gerrit)

unread,
Dec 18, 2025, 1:36:24 PM (2 days ago) Dec 18
to Andrew Williams, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, net-r...@chromium.org
Attention needed from Andrew Williams

Mark Pearson voted and added 2 comments

Votes added by Mark Pearson

Code-Review+1

2 comments

Patchset-level comments
Andrew Williams . unresolved

Note that this was also reviewed via https://chromium-review.googlesource.com/c/chromium/src/+/7266460, but split out here for owners approval

Mark Pearson

I'm curious: is the aggregate of this change going to be a performance win?

File components/metrics/net/net_metrics_log_uploader.h
Line 12, Patchset 1 (Latest):#include "components/metrics/metrics_log.h"
Mark Pearson . unresolved

Please explicitly
#include "base/memory/scoped_refptr.h"

(unless this is a style violation that I'm not aware of)

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Williams
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
Gerrit-Change-Number: 7270689
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Andrew Williams <awi...@chromium.org>
Gerrit-Reviewer: Mark Pearson <mpea...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: gwsq
Gerrit-Attention: Andrew Williams <awi...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 18:36:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Andrew Williams <awi...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Williams (Gerrit)

unread,
Dec 19, 2025, 11:49:53 AM (2 days ago) Dec 19
to Mark Pearson, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, net-r...@chromium.org

Andrew Williams voted and added 3 comments

Votes added by Andrew Williams

Commit-Queue+2

3 comments

Patchset-level comments
File-level comment, Patchset 1:
Andrew Williams . resolved

Note that this was also reviewed via https://chromium-review.googlesource.com/c/chromium/src/+/7266460, but split out here for owners approval

Mark Pearson

I'm curious: is the aggregate of this change going to be a performance win?

Andrew Williams

I'm not sure... I think it would depend on how frequently the DownloadHeadersOnly calls are made and how big the responses tend to be, and I don't have any data on this. My guess would be that these calls aren't happening too frequently, and also since the responses aren't used today it seems likely that the responses, if any, are small.

Still, I think using DownloadHeadersOnly when no response data is needed is a slight simplification in a many cases and better conveys how the code interacts with the request responses.

File-level comment, Patchset 2 (Latest):
Andrew Williams . resolved

Thanks Mark!

File components/metrics/net/net_metrics_log_uploader.h
Line 12, Patchset 1:#include "components/metrics/metrics_log.h"
Mark Pearson . resolved

Please explicitly
#include "base/memory/scoped_refptr.h"

(unless this is a style violation that I'm not aware of)

Andrew Williams

good catch! I missed this one

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
    Gerrit-Change-Number: 7270689
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andrew Williams <awi...@chromium.org>
    Gerrit-Reviewer: Andrew Williams <awi...@chromium.org>
    Gerrit-Reviewer: Mark Pearson <mpea...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: gwsq
    Gerrit-Comment-Date: Fri, 19 Dec 2025 16:49:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Mark Pearson <mpea...@chromium.org>
    Comment-In-Reply-To: Andrew Williams <awi...@chromium.org>
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Dec 19, 2025, 12:10:22 PM (2 days ago) Dec 19
    to Andrew Williams, Mark Pearson, Chromium Metrics Reviews, chromium...@chromium.org, asvitki...@chromium.org, chromiumme...@microsoft.com, net-r...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    1 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: components/metrics/net/net_metrics_log_uploader.h
    Insertions: 1, Deletions: 0.

    @@ -9,6 +9,7 @@
    #include <string>
    #include <string_view>

    +#include "base/memory/scoped_refptr.h"
    #include "components/metrics/metrics_log.h"
    #include "components/metrics/metrics_log_uploader.h"
    #include "third_party/metrics_proto/reporting_info.pb.h"
    ```

    Change information

    Commit message:
    Use SimpleURLLoader::DownloadHeadersOnly in components/metrics

    This change replaces calls to SimpleURLLoader's
    DownloadToStringOfUnboundedSizeUntilCrashAndDie with DownloadHeadersOnly
    in various parts of the Chrome codebase. The body of the response was
    not being used in these instances, so having SimpleURLLoader not store
    the response body is more efficient and better conveys how the callers
    interact with the request responses.

    No major changes in functionality are expected as a result of this other
    than SimpleURLLoader no longer saving the response bodies while the
    request is being downloaded.

    This CL was uploaded by git cl split.
    Bug: None
    Change-Id: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
    Reviewed-by: Mark Pearson <mpea...@chromium.org>
    Commit-Queue: Andrew Williams <awi...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1561190}
    Files:
    • M components/metrics/net/net_metrics_log_uploader.cc
    • M components/metrics/net/net_metrics_log_uploader.h
    Change size: S
    Delta: 2 files changed, 11 insertions(+), 7 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Mark Pearson
    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: I549e9b9bf8fdc03ac244be0fce1e61b2b0874490
    Gerrit-Change-Number: 7270689
    Gerrit-PatchSet: 3
    Gerrit-Owner: Andrew Williams <awi...@chromium.org>
    Gerrit-Reviewer: Andrew Williams <awi...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Mark Pearson <mpea...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages