Commit 4a95d41a authored by David Van Cleve's avatar David Van Cleve Committed by Chromium LUCI CQ

fetch: Remove the now-unneeded TrustTokens.FetchFailedReason enum

crrev.com/c/2442229 added some temporary histogramming to FetchManager to identify why failing Trust Tokens operations were failing. Now that
we've found the cause (crbug.com/1128174; internal due to internal repro instructions, sorry), we can remove this instrumentation and clear up a hundred lines or so in fetch_manager.cc. We're keeping
Net.TrustTokens.NetErrorForTrustTokenOperation, which we added at close to the same time, around to use a health indicator.

Change-Id: Ib7178d30a03b1aaa529aafdd4c9f36cfc84e1dbc
Fixed: 1133944
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561778
Commit-Queue: David Van Cleve <davidvc@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832069}
parent 4eb86007
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "services/network/trust_tokens/test/trust_token_test_util.h" #include "services/network/trust_tokens/test/trust_token_test_util.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/resource_request_blocked_reason.h"
#include "url/gurl.h" #include "url/gurl.h"
#include "url/origin.h" #include "url/origin.h"
#include "url/url_canon_stdstring.h" #include "url/url_canon_stdstring.h"
...@@ -546,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsNetErrorCodes) { ...@@ -546,7 +545,7 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsNetErrorCodes) {
} }
IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) { IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) {
// Verify that the Net.TrustTokens.FetchFailedReason.* metrics // Verify that the Net.TrustTokens.NetErrorForFetchFailure.* metrics
// record successfully by testing one case with a blocked resource, one case // record successfully by testing one case with a blocked resource, one case
// with a generic net-stack failure, and one case with a Trust Tokens // with a generic net-stack failure, and one case with a Trust Tokens
// operation failure. // operation failure.
...@@ -568,10 +567,6 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) { ...@@ -568,10 +567,6 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) {
.catch(err => err.name);)")); .catch(err => err.name);)"));
content::FetchHistogramsFromChildProcesses(); content::FetchHistogramsFromChildProcesses();
histograms.ExpectUniqueSample(
"Net.TrustTokens.FetchFailedReason.Issuance",
9 /* fetch_manager.cc::FailedReason::kOtherNonBlockReason */,
/*expected_count=*/1);
histograms.ExpectUniqueSample( histograms.ExpectUniqueSample(
"Net.TrustTokens.NetErrorForFetchFailure.Issuance", net::ERR_FAILED, "Net.TrustTokens.NetErrorForFetchFailure.Issuance", net::ERR_FAILED,
/*expected_count=*/1); /*expected_count=*/1);
...@@ -585,10 +580,6 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) { ...@@ -585,10 +580,6 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) {
.catch(err => err.name);)")); .catch(err => err.name);)"));
content::FetchHistogramsFromChildProcesses(); content::FetchHistogramsFromChildProcesses();
histograms.ExpectUniqueSample(
"Net.TrustTokens.FetchFailedReason.Redemption",
8 /* fetch_manager.cc::FailedReason::kTrustTokensError */,
/*expected_count=*/1);
histograms.ExpectUniqueSample( histograms.ExpectUniqueSample(
"Net.TrustTokens.NetErrorForFetchFailure.Redemption", "Net.TrustTokens.NetErrorForFetchFailure.Redemption",
net::ERR_TRUST_TOKEN_OPERATION_FAILED, net::ERR_TRUST_TOKEN_OPERATION_FAILED,
...@@ -613,12 +604,6 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) { ...@@ -613,12 +604,6 @@ IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, RecordsFetchFailureReasons) {
HasSubstr("Failed to fetch")); HasSubstr("Failed to fetch"));
content::FetchHistogramsFromChildProcesses(); content::FetchHistogramsFromChildProcesses();
histograms.ExpectBucketCount(
"Net.TrustTokens.FetchFailedReason.Issuance",
// fetch_manager.cc::FailedReason::
// kCorpNotSameOriginAfterDefaultedToSameOriginByCoep
21,
/*expected_count=*/1);
histograms.ExpectBucketCount( histograms.ExpectBucketCount(
"Net.TrustTokens.NetErrorForFetchFailure.Issuance", "Net.TrustTokens.NetErrorForFetchFailure.Issuance",
net::ERR_BLOCKED_BY_RESPONSE, net::ERR_BLOCKED_BY_RESPONSE,
......
...@@ -4829,6 +4829,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -4829,6 +4829,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram base="true" name="Net.TrustTokens.FetchFailedReason" <histogram base="true" name="Net.TrustTokens.FetchFailedReason"
enum="FetchFailedReasonOrResourceRequestBlockedReason" enum="FetchFailedReasonOrResourceRequestBlockedReason"
expires_after="2021-03-30"> expires_after="2021-03-30">
<obsolete>
This was a temporary addition used for debugging during M88.
</obsolete>
<!-- Name completed by histogram_suffixes name="TrustTokenOperationType" --> <!-- Name completed by histogram_suffixes name="TrustTokenOperationType" -->
<owner>davidvc@chromium.org</owner> <owner>davidvc@chromium.org</owner>
...@@ -4850,8 +4853,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -4850,8 +4853,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>privacy-sandbox-dev@chromium.org</owner> <owner>privacy-sandbox-dev@chromium.org</owner>
<summary> <summary>
The net error for a failed Fetch API call with an associated Trust Tokens The net error for a failed Fetch API call with an associated Trust Tokens
operation. This might help debug a surfeit of 'TypeError: failed to fetch' operation. This was originally added to help debug a surfeit of 'TypeError:
observed in live testing. failed to fetch' observed in live testing, and it is now retained since it's
useful for ongoing health monitoring.
</summary> </summary>
</histogram> </histogram>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment