Add HTTP2_CODE_COUNT_N API and decompress_failure_3 counters to debug source of
DECOMPRESS_FAILURE errors.

Note that on any code path multiple of these macros are expected to be hit.

gfe-relnote: n/a, add CODE_COUNT macros for debugging.
PiperOrigin-RevId: 292355227
Change-Id: I9b02119c30af03016073307feedee896f397b24c
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
index 1f1f4f0..2173756 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -5,6 +5,7 @@
 #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h"
 
 #include "net/third_party/quiche/src/http2/platform/api/http2_estimate_memory_usage.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_flags.h"
 #include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
 #include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
 #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
@@ -58,6 +59,7 @@
       HTTP2_DVLOG(1) << "Name length (" << len << ") is longer than permitted ("
                      << max_string_size_bytes_ << ")";
       ReportError("HPACK entry name size is too long.");
+      HTTP2_CODE_COUNT_N(decompress_failure_3, 18, 23);
       return;
     }
     name_.OnStart(huffman_encoded, len);
@@ -71,6 +73,7 @@
   DCHECK_EQ(maybe_name_index_, 0u);
   if (!error_detected_ && !name_.OnData(data, len)) {
     ReportError("Error decoding HPACK entry name.");
+    HTTP2_CODE_COUNT_N(decompress_failure_3, 19, 23);
   }
 }
 
@@ -79,6 +82,7 @@
   DCHECK_EQ(maybe_name_index_, 0u);
   if (!error_detected_ && !name_.OnEnd()) {
     ReportError("Error decoding HPACK entry name.");
+    HTTP2_CODE_COUNT_N(decompress_failure_3, 20, 23);
   }
 }
 
@@ -91,6 +95,7 @@
                      << ") is longer than permitted (" << max_string_size_bytes_
                      << ")";
       ReportError("HPACK entry value size is too long.");
+      HTTP2_CODE_COUNT_N(decompress_failure_3, 21, 23);
       return;
     }
     value_.OnStart(huffman_encoded, len);
@@ -103,6 +108,7 @@
                  << Http2HexDump(quiche::QuicheStringPiece(data, len));
   if (!error_detected_ && !value_.OnData(data, len)) {
     ReportError("Error decoding HPACK entry value.");
+    HTTP2_CODE_COUNT_N(decompress_failure_3, 22, 23);
   }
 }
 
@@ -113,6 +119,7 @@
   }
   if (!value_.OnEnd()) {
     ReportError("Error decoding HPACK entry value.");
+    HTTP2_CODE_COUNT_N(decompress_failure_3, 23, 23);
     return;
   }
   if (maybe_name_index_ == 0) {