Put Google QUIC Connection Close code in the extracted code field

When processing Google QUIC Connection Close frames, place a copy
of the close code into the QuicConnectionCloseFrame::extracted_error_code
field. In this way, as we migrate through a hybrid Google/IETF QUIC
implementation, the Google QUIC close code is always available in
this field, regardless of the QUIC type in use.  This does not change
the existing code's placement of the error code in
QuicConnectionCloseFrame::quic_error_code.

gfe-relnote: N/A, part of a revision of the ConnectionCloseFrame in an earlier CL.
PiperOrigin-RevId: 262114442
Change-Id: Iaa472c1e040dd7de4d5b6a3c2484d5aad1408413
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc
index ea9d9f5..13669d9 100644
--- a/quic/core/quic_framer.cc
+++ b/quic/core/quic_framer.cc
@@ -4032,6 +4032,11 @@
 
   frame->quic_error_code = static_cast<QuicErrorCode>(error_code);
 
+  // For Google QUIC connection closes, copy the Google QUIC error code to
+  // the extracted error code field so that the Google QUIC error code is always
+  // available in extracted_error_code.
+  frame->extracted_error_code = frame->quic_error_code;
+
   QuicStringPiece error_details;
   if (!reader->ReadStringPiece16(&error_details)) {
     set_detailed_error("Unable to read connection close error details.");