Create a shared interface to access QuicTransport*Session::IsSessionReady().

Also slightly alter the logic to make sure that the session does not stop being ready when the connection is closed.

gfe-relnote: n/a (not used in production)
PiperOrigin-RevId: 274230704
Change-Id: Idfe2d0135e5f35b1974619066743cc9edf8c44a9
diff --git a/quic/quic_transport/quic_transport_client_session.h b/quic/quic_transport/quic_transport_client_session.h
index 69e7d8e..32149df 100644
--- a/quic/quic_transport/quic_transport_client_session.h
+++ b/quic/quic_transport/quic_transport_client_session.h
@@ -21,11 +21,14 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/quic_transport/quic_transport_protocol.h"
+#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_session_interface.h"
 
 namespace quic {
 
 // A client session for the QuicTransport protocol.
-class QUIC_EXPORT QuicTransportClientSession : public QuicSession {
+class QUIC_EXPORT QuicTransportClientSession
+    : public QuicSession,
+      public QuicTransportSessionInterface {
  public:
   QuicTransportClientSession(QuicConnection* connection,
                              Visitor* owner,
@@ -50,10 +53,7 @@
     return crypto_stream_.get();
   }
 
-  bool IsSessionReady() const {
-    return IsCryptoHandshakeConfirmed() && client_indication_sent_ &&
-           connection()->connected();
-  }
+  bool IsSessionReady() const override { return ready_; }
 
   void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override;
 
@@ -78,6 +78,7 @@
   std::unique_ptr<QuicCryptoClientStream> crypto_stream_;
   url::Origin origin_;
   bool client_indication_sent_ = false;
+  bool ready_ = false;
 };
 
 }  // namespace quic