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.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Reviewer source(s):
mpea...@chromium.org is from context(analysis/uma/chrome-metrics.gwsq)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Note that this was also reviewed via https://chromium-review.googlesource.com/c/chromium/src/+/7266460, but split out here for owners approval
| Code-Review | +1 |
Note that this was also reviewed via https://chromium-review.googlesource.com/c/chromium/src/+/7266460, but split out here for owners approval
I'm curious: is the aggregate of this change going to be a performance win?
#include "components/metrics/metrics_log.h"Please explicitly
#include "base/memory/scoped_refptr.h"
(unless this is a style violation that I'm not aware of)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Mark PearsonNote that this was also reviewed via https://chromium-review.googlesource.com/c/chromium/src/+/7266460, but split out here for owners approval
I'm curious: is the aggregate of this change going to be a performance win?
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.
Please explicitly
#include "base/memory/scoped_refptr.h"(unless this is a style violation that I'm not aware of)
good catch! I missed this one
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
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"
```
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.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |