Deprecate App-Bound re-encryption metrics

Metrics showed an almost zero failure rate and even if failure occurs it
will retry.

This CL therefore removes the metrics as they aren't needed.

BUG=407543539, 383157187
OBSOLETE_HISTOGRAMS=Removed as no longer needed

Change-Id: I8b339c91e4bf803179864833c06c9cd70a55ac93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6454813
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1447158}
diff --git a/chrome/browser/os_crypt/app_bound_encryption_win.cc b/chrome/browser/os_crypt/app_bound_encryption_win.cc
index 9f062d48..d4c0b5b 100644
--- a/chrome/browser/os_crypt/app_bound_encryption_win.cc
+++ b/chrome/browser/os_crypt/app_bound_encryption_win.cc
@@ -234,15 +234,10 @@
     HRESULT encrypt_hr =
         elevator->EncryptData(protection_level, plaintext_data.Get(),
                               reencrypted_data.Receive(), &encrypt_last_error);
-    base::UmaHistogramSparse("OSCrypt.AppBound.ReEncrypt.ResultCode",
-                             encrypt_hr);
     if (SUCCEEDED(encrypt_hr)) {
       new_ciphertext.emplace(
           reinterpret_cast<std::string::value_type*>(reencrypted_data.Get()),
           reencrypted_data.ByteLength());
-    } else {
-      base::UmaHistogramSparse("OSCrypt.AppBound.ReEncrypt.ResultLastError",
-                               encrypt_last_error);
     }
   }
 
diff --git a/chrome/browser/os_crypt/app_bound_encryption_win_browsertest.cc b/chrome/browser/os_crypt/app_bound_encryption_win_browsertest.cc
index c6fa7071..67e7482 100644
--- a/chrome/browser/os_crypt/app_bound_encryption_win_browsertest.cc
+++ b/chrome/browser/os_crypt/app_bound_encryption_win_browsertest.cc
@@ -532,8 +532,6 @@
   EXPECT_EQ(plaintext, returned_plaintext);
 
   if (ExpectReencrypt()) {
-    histograms.ExpectUniqueSample("OSCrypt.AppBound.ReEncrypt.ResultCode", S_OK,
-                                  1u);
     ASSERT_TRUE(maybe_new_ciphertext);
 
     std::optional<std::string> even_newer_ciphertext;
@@ -545,10 +543,8 @@
     ASSERT_HRESULT_SUCCEEDED(hr);
     EXPECT_EQ(plaintext, returned_plaintext);
   } else {
-    histograms.ExpectTotalCount("OSCrypt.AppBound.ReEncrypt.ResultCode", 0);
     ASSERT_FALSE(maybe_new_ciphertext);
   }
-  histograms.ExpectTotalCount("OSCrypt.AppBound.ReEncrypt.ResultLastError", 0);
 }
 
 // This could be a unit test, but it needs the service installed to work, so
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml
index d9397fc0..9a183ed 100644
--- a/tools/metrics/histograms/metadata/others/histograms.xml
+++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -6976,30 +6976,6 @@
   </summary>
 </histogram>
 
-<histogram name="OSCrypt.AppBound.ReEncrypt.ResultCode" enum="Hresult"
-    expires_after="2025-05-11">
-  <owner>wfh@chromium.org</owner>
-  <owner>nparker@chromium.org</owner>
-  <summary>
-    The result code of the application-bound re-encrypt operation. This is
-    logged after a re-encryption attempt is made for decrypted data if
-    application-bound encryption signals that a re-encryption is required, for
-    supported Windows installs.
-  </summary>
-</histogram>
-
-<histogram name="OSCrypt.AppBound.ReEncrypt.ResultLastError"
-    enum="WinGetLastError" expires_after="2025-05-11">
-  <owner>wfh@chromium.org</owner>
-  <owner>nparker@chromium.org</owner>
-  <summary>
-    The GetLastError code for a failed application-bound re-encrypt operation.
-    This is logged after a re-encryption attempt is made for decrypted data if
-    application-bound encryption signals that a re-encryption is required, only
-    if the call to re-encrypt fails, for supported Windows installs.
-  </summary>
-</histogram>
-
 <histogram name="OSCrypt.AppBoundEncryption.SupportLevel"
     enum="AppBoundEncryptionSupportLevel" expires_after="2025-08-24">
   <owner>wfh@chromium.org</owner>