Remove most push-related parts of QuicSpdyClientSessionBase.

PiperOrigin-RevId: 570707775
diff --git a/quiche/quic/core/http/quic_client_promised_info.cc b/quiche/quic/core/http/quic_client_promised_info.cc
index db53585..54369b8 100644
--- a/quiche/quic/core/http/quic_client_promised_info.cc
+++ b/quiche/quic/core/http/quic_client_promised_info.cc
@@ -81,10 +81,8 @@
   }
 }
 
-void QuicClientPromisedInfo::Reset(QuicRstStreamErrorCode error_code) {
+void QuicClientPromisedInfo::Reset(QuicRstStreamErrorCode /*error_code*/) {
   QuicClientPushPromiseIndex::Delegate* delegate = client_request_delegate_;
-  session_->ResetPromised(id_, error_code);
-  session_->DeletePromised(this);
   if (delegate) {
     delegate->OnRendezvousResult(nullptr);
   }
@@ -96,19 +94,6 @@
     Reset(QUIC_PROMISE_VARY_MISMATCH);
     return QUIC_FAILURE;
   }
-  QuicSpdyStream* stream = session_->GetPromisedStream(id_);
-  if (!stream) {
-    // This shouldn't be possible, as |ClientRequest| guards against
-    // closed stream for the synchronous case.  And in the
-    // asynchronous case, a RST can only be caught by |OnAlarm()|.
-    QUIC_BUG(quic_bug_10378_1) << "missing promised stream" << id_;
-  }
-  QuicClientPushPromiseIndex::Delegate* delegate = client_request_delegate_;
-  session_->DeletePromised(this);
-  // Stream can start draining now
-  if (delegate) {
-    delegate->OnRendezvousResult(stream);
-  }
   return QUIC_SUCCESS;
 }
 
@@ -116,8 +101,6 @@
     const Http2HeaderBlock& request_headers,
     QuicClientPushPromiseIndex::Delegate* delegate) {
   if (session_->IsClosedStream(id_)) {
-    // There was a RST on the response stream.
-    session_->DeletePromised(this);
     return QUIC_FAILURE;
   }
 
diff --git a/quiche/quic/core/http/quic_spdy_client_session_base.cc b/quiche/quic/core/http/quic_spdy_client_session_base.cc
index 4684ba9..b730251 100644
--- a/quiche/quic/core/http/quic_spdy_client_session_base.cc
+++ b/quiche/quic/core/http/quic_spdy_client_session_base.cc
@@ -6,7 +6,6 @@
 
 #include <string>
 
-#include "quiche/quic/core/http/quic_client_promised_info.h"
 #include "quiche/quic/core/http/spdy_server_push_utils.h"
 #include "quiche/quic/core/quic_utils.h"
 #include "quiche/quic/platform/api/quic_flags.h"
@@ -24,11 +23,6 @@
       push_promise_index_(push_promise_index) {}
 
 QuicSpdyClientSessionBase::~QuicSpdyClientSessionBase() {
-  //  all promised streams for this session
-  for (auto& it : promised_by_id_) {
-    QUIC_DVLOG(1) << "erase stream " << it.first << " url " << it.second->url();
-    push_promise_index_->promised_by_url()->erase(it.second->url());
-  }
   DeleteConnection();
 }
 
@@ -36,126 +30,9 @@
   QuicSpdySession::OnConfigNegotiated();
 }
 
-void QuicSpdyClientSessionBase::OnInitialHeadersComplete(
-    QuicStreamId stream_id, const Http2HeaderBlock& response_headers) {
-  // Note that the strong ordering of the headers stream means that
-  // QuicSpdyClientStream::OnPromiseHeadersComplete must have already
-  // been called (on the associated stream) if this is a promised
-  // stream. However, this stream may not have existed at this time,
-  // hence the need to query the session.
-  QuicClientPromisedInfo* promised = GetPromisedById(stream_id);
-  if (!promised) return;
-
-  promised->OnResponseHeaders(response_headers);
-}
-
-bool QuicSpdyClientSessionBase::HandlePromised(
-    QuicStreamId /* associated_id */, QuicStreamId promised_id,
-    const Http2HeaderBlock& headers) {
-  // TODO(b/136295430): Do not treat |promised_id| as a stream ID when using
-  // IETF QUIC.
-  // Due to pathalogical packet re-ordering, it is possible that
-  // frames for the promised stream have already arrived, and the
-  // promised stream could be active or closed.
-  if (IsClosedStream(promised_id)) {
-    // There was a RST on the data stream already, perhaps
-    // QUIC_REFUSED_STREAM?
-    QUIC_DVLOG(1) << "Promise ignored for stream " << promised_id
-                  << " that is already closed";
-    return false;
-  }
-
-  if (push_promise_index_->promised_by_url()->size() >= get_max_promises()) {
-    QUIC_DVLOG(1) << "Too many promises, rejecting promise for stream "
-                  << promised_id;
-    ResetPromised(promised_id, QUIC_REFUSED_STREAM);
-    return false;
-  }
-
-  const std::string url =
-      SpdyServerPushUtils::GetPromisedUrlFromHeaders(headers);
-  QuicClientPromisedInfo* old_promised = GetPromisedByUrl(url);
-  if (old_promised) {
-    QUIC_DVLOG(1) << "Promise for stream " << promised_id
-                  << " is duplicate URL " << url
-                  << " of previous promise for stream " << old_promised->id();
-    ResetPromised(promised_id, QUIC_DUPLICATE_PROMISE_URL);
-    return false;
-  }
-
-  if (GetPromisedById(promised_id)) {
-    // OnPromiseHeadersComplete() would have closed the connection if
-    // promised id is a duplicate.
-    QUIC_BUG(quic_bug_10412_1) << "Duplicate promise for id " << promised_id;
-    return false;
-  }
-
-  QuicClientPromisedInfo* promised =
-      new QuicClientPromisedInfo(this, promised_id, url);
-  std::unique_ptr<QuicClientPromisedInfo> promised_owner(promised);
-  promised->Init();
-  QUIC_DVLOG(1) << "stream " << promised_id << " emplace url " << url;
-  (*push_promise_index_->promised_by_url())[url] = promised;
-  promised_by_id_[promised_id] = std::move(promised_owner);
-  bool result = promised->OnPromiseHeaders(headers);
-  if (result) {
-    QUICHE_DCHECK(promised_by_id_.find(promised_id) != promised_by_id_.end());
-  }
-  return result;
-}
-
-QuicClientPromisedInfo* QuicSpdyClientSessionBase::GetPromisedByUrl(
-    const std::string& url) {
-  auto it = push_promise_index_->promised_by_url()->find(url);
-  if (it != push_promise_index_->promised_by_url()->end()) {
-    return it->second;
-  }
-  return nullptr;
-}
-
-QuicClientPromisedInfo* QuicSpdyClientSessionBase::GetPromisedById(
-    const QuicStreamId id) {
-  auto it = promised_by_id_.find(id);
-  if (it != promised_by_id_.end()) {
-    return it->second.get();
-  }
-  return nullptr;
-}
-
-QuicSpdyStream* QuicSpdyClientSessionBase::GetPromisedStream(
-    const QuicStreamId id) {
-  QuicStream* stream = GetActiveStream(id);
-  if (stream != nullptr) {
-    return static_cast<QuicSpdyStream*>(stream);
-  }
-  return nullptr;
-}
-
-void QuicSpdyClientSessionBase::DeletePromised(
-    QuicClientPromisedInfo* promised) {
-  push_promise_index_->promised_by_url()->erase(promised->url());
-  // Since promised_by_id_ contains the unique_ptr, this will destroy
-  // promised.
-  // ToDo: Consider implementing logic to send a new MAX_PUSH_ID frame to allow
-  // another stream to be promised.
-  promised_by_id_.erase(promised->id());
-  if (!VersionUsesHttp3(transport_version())) {
-    headers_stream()->MaybeReleaseSequencerBuffer();
-  }
-}
-
 void QuicSpdyClientSessionBase::OnPushStreamTimedOut(
     QuicStreamId /*stream_id*/) {}
 
-void QuicSpdyClientSessionBase::ResetPromised(
-    QuicStreamId id, QuicRstStreamErrorCode error_code) {
-  QUICHE_DCHECK(QuicUtils::IsServerInitiatedStreamId(transport_version(), id));
-  ResetStream(id, error_code);
-  if (!IsOpenStream(id) && !IsClosedStream(id)) {
-    MaybeIncreaseLargestPeerStreamId(id);
-  }
-}
-
 void QuicSpdyClientSessionBase::OnStreamClosed(QuicStreamId stream_id) {
   QuicSpdySession::OnStreamClosed(stream_id);
   if (!VersionUsesHttp3(transport_version())) {
@@ -164,7 +41,7 @@
 }
 
 bool QuicSpdyClientSessionBase::ShouldReleaseHeadersStreamSequencerBuffer() {
-  return !HasActiveRequestStreams() && promised_by_id_.empty();
+  return !HasActiveRequestStreams();
 }
 
 bool QuicSpdyClientSessionBase::ShouldKeepConnectionAlive() const {
diff --git a/quiche/quic/core/http/quic_spdy_client_session_base.h b/quiche/quic/core/http/quic_spdy_client_session_base.h
index 0aaf7a7..77ca337 100644
--- a/quiche/quic/core/http/quic_spdy_client_session_base.h
+++ b/quiche/quic/core/http/quic_spdy_client_session_base.h
@@ -52,21 +52,6 @@
 
   void OnConfigNegotiated() override;
 
-  // Called by |QuicSpdyClientStream| on receipt of response headers,
-  // needed to detect promised server push streams, as part of
-  // client-request to push-stream rendezvous.
-  void OnInitialHeadersComplete(QuicStreamId stream_id,
-                                const spdy::Http2HeaderBlock& response_headers);
-
-  // Called by |QuicSpdyClientStream| on receipt of PUSH_PROMISE, does
-  // some session level validation and creates the
-  // |QuicClientPromisedInfo| inserting into maps by (promised) id and
-  // url. Returns true if a new push promise is accepted. Resets the promised
-  // stream and returns false otherwise.
-  virtual bool HandlePromised(QuicStreamId associated_id,
-                              QuicStreamId promised_id,
-                              const spdy::Http2HeaderBlock& headers);
-
   // For cross-origin server push, this should verify the server is
   // authoritative per [RFC2818], Section 3.  Roughly, subjectAltName
   // list in the certificate should contain a matching DNS name, or IP
@@ -74,29 +59,11 @@
   // the PUSH_PROMISE frame, port if present there will be dropped.
   virtual bool IsAuthorized(const std::string& hostname) = 0;
 
-  // Session retains ownership.
-  QuicClientPromisedInfo* GetPromisedByUrl(const std::string& url);
-  // Session retains ownership.
-  QuicClientPromisedInfo* GetPromisedById(const QuicStreamId id);
-
-  //
-  QuicSpdyStream* GetPromisedStream(const QuicStreamId id);
-
   // Removes |promised| from the maps by url.
   void ErasePromisedByUrl(QuicClientPromisedInfo* promised);
 
-  // Removes |promised| from the maps by url and id and destroys
-  // promised.
-  virtual void DeletePromised(QuicClientPromisedInfo* promised);
-
   virtual void OnPushStreamTimedOut(QuicStreamId stream_id);
 
-  // Sends Rst for the stream, and makes sure that future calls to
-  // IsClosedStream(id) return true, which ensures that any subsequent
-  // frames related to this stream will be ignored (modulo flow
-  // control accounting).
-  void ResetPromised(QuicStreamId id, QuicRstStreamErrorCode error_code);
-
   // Release headers stream's sequencer buffer if it's empty.
   void OnStreamClosed(QuicStreamId stream_id) override;
 
@@ -106,11 +73,6 @@
   // Override to wait for all received responses to be consumed by application.
   bool ShouldKeepConnectionAlive() const override;
 
-  size_t get_max_promises() const {
-    return max_open_incoming_unidirectional_streams() *
-           kMaxPromisedStreamsMultiplier;
-  }
-
   QuicClientPushPromiseIndex* push_promise_index() {
     return push_promise_index_;
   }
@@ -119,19 +81,7 @@
   bool OnSettingsFrame(const SettingsFrame& frame) override;
 
  private:
-  // For QuicSpdyClientStream to detect that a response corresponds to a
-  // promise.
-  using QuicPromisedByIdMap =
-      absl::flat_hash_map<QuicStreamId,
-                          std::unique_ptr<QuicClientPromisedInfo>>;
-
-  // As per rfc7540, section 10.5: track promise streams in "reserved
-  // (remote)".  The primary key is URL from the promise request
-  // headers.  The promised stream id is a secondary key used to get
-  // promise info when the response headers of the promised stream
-  // arrive.
   QuicClientPushPromiseIndex* push_promise_index_;
-  QuicPromisedByIdMap promised_by_id_;
 };
 
 }  // namespace quic
diff --git a/quiche/quic/core/http/quic_spdy_client_session_test.cc b/quiche/quic/core/http/quic_spdy_client_session_test.cc
index ba16205..7949fb7 100644
--- a/quiche/quic/core/http/quic_spdy_client_session_test.cc
+++ b/quiche/quic/core/http/quic_spdy_client_session_test.cc
@@ -87,11 +87,7 @@
 
 class QuicSpdyClientSessionTest : public QuicTestWithParam<ParsedQuicVersion> {
  protected:
-  QuicSpdyClientSessionTest()
-      : promised_stream_id_(
-            QuicUtils::GetInvalidStreamId(GetParam().transport_version)),
-        associated_stream_id_(
-            QuicUtils::GetInvalidStreamId(GetParam().transport_version)) {
+  QuicSpdyClientSessionTest() {
     auto client_cache = std::make_unique<test::SimpleSessionCache>();
     client_session_cache_ = client_cache.get();
     client_crypto_config_ = std::make_unique<QuicCryptoClientConfig>(
@@ -122,16 +118,6 @@
         std::make_unique<NullEncrypter>(connection_->perspective()));
     crypto_stream_ = static_cast<QuicCryptoClientStream*>(
         session_->GetMutableCryptoStream());
-    push_promise_[":path"] = "/bar";
-    push_promise_[":authority"] = "www.google.com";
-    push_promise_[":method"] = "GET";
-    push_promise_[":scheme"] = "https";
-    promise_url_ =
-        SpdyServerPushUtils::GetPromisedUrlFromHeaders(push_promise_);
-    promised_stream_id_ = GetNthServerInitiatedUnidirectionalStreamId(
-        connection_->transport_version(), 0);
-    associated_stream_id_ = GetNthClientInitiatedBidirectionalStreamId(
-        connection_->transport_version(), 0);
   }
 
   // The function ensures that A) the MAX_STREAMS frames get properly deleted
@@ -217,10 +203,6 @@
   ::testing::NiceMock<PacketSavingConnection>* connection_;
   std::unique_ptr<TestQuicSpdyClientSession> session_;
   QuicClientPushPromiseIndex push_promise_index_;
-  Http2HeaderBlock push_promise_;
-  std::string promise_url_;
-  QuicStreamId promised_stream_id_;
-  QuicStreamId associated_stream_id_;
   test::SimpleSessionCache* client_session_cache_;
 };
 
@@ -557,216 +539,6 @@
   session_->ProcessUdpPacket(client_address, server_address, *received);
 }
 
-TEST_P(QuicSpdyClientSessionTest, PushPromiseHandlePromise) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  session_->CreateOutgoingBidirectionalStream();
-
-  EXPECT_TRUE(session_->HandlePromised(associated_stream_id_,
-                                       promised_stream_id_, push_promise_));
-
-  EXPECT_NE(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, PushPromiseAlreadyClosed) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  session_->CreateOutgoingBidirectionalStream();
-  session_->GetOrCreateStream(promised_stream_id_);
-
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_REFUSED_STREAM));
-
-  session_->ResetPromised(promised_stream_id_, QUIC_REFUSED_STREAM);
-  Http2HeaderBlock promise_headers;
-  EXPECT_FALSE(session_->HandlePromised(associated_stream_id_,
-                                        promised_stream_id_, promise_headers));
-
-  // Verify that the promise was not created.
-  EXPECT_EQ(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_EQ(session_->GetPromisedByUrl(promise_url_), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, PushPromiseDuplicateUrl) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  session_->CreateOutgoingBidirectionalStream();
-
-  EXPECT_TRUE(session_->HandlePromised(associated_stream_id_,
-                                       promised_stream_id_, push_promise_));
-
-  EXPECT_NE(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr);
-
-  promised_stream_id_ +=
-      QuicUtils::StreamIdDelta(connection_->transport_version());
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_DUPLICATE_PROMISE_URL));
-
-  EXPECT_FALSE(session_->HandlePromised(associated_stream_id_,
-                                        promised_stream_id_, push_promise_));
-
-  // Verify that the promise was not created.
-  EXPECT_EQ(session_->GetPromisedById(promised_stream_id_), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, ReceivingPromiseEnhanceYourCalm) {
-  CompleteCryptoHandshake();
-  for (size_t i = 0u; i < session_->get_max_promises(); i++) {
-    push_promise_[":path"] = absl::StrCat("/bar", i);
-
-    QuicStreamId id =
-        promised_stream_id_ +
-        i * QuicUtils::StreamIdDelta(connection_->transport_version());
-
-    EXPECT_TRUE(
-        session_->HandlePromised(associated_stream_id_, id, push_promise_));
-
-    // Verify that the promise is in the unclaimed streams map.
-    std::string promise_url(
-        SpdyServerPushUtils::GetPromisedUrlFromHeaders(push_promise_));
-    EXPECT_NE(session_->GetPromisedByUrl(promise_url), nullptr);
-    EXPECT_NE(session_->GetPromisedById(id), nullptr);
-  }
-
-  // One more promise, this should be refused.
-  int i = session_->get_max_promises();
-  push_promise_[":path"] = absl::StrCat("/bar", i);
-
-  QuicStreamId id =
-      promised_stream_id_ +
-      i * QuicUtils::StreamIdDelta(connection_->transport_version());
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_, OnStreamReset(id, QUIC_REFUSED_STREAM));
-  EXPECT_FALSE(
-      session_->HandlePromised(associated_stream_id_, id, push_promise_));
-
-  // Verify that the promise was not created.
-  std::string promise_url(
-      SpdyServerPushUtils::GetPromisedUrlFromHeaders(push_promise_));
-  EXPECT_EQ(session_->GetPromisedById(id), nullptr);
-  EXPECT_EQ(session_->GetPromisedByUrl(promise_url), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, IsClosedTrueAfterResetPromisedAlreadyOpen) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  session_->GetOrCreateStream(promised_stream_id_);
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_REFUSED_STREAM));
-  session_->ResetPromised(promised_stream_id_, QUIC_REFUSED_STREAM);
-  EXPECT_TRUE(session_->IsClosedStream(promised_stream_id_));
-}
-
-TEST_P(QuicSpdyClientSessionTest, IsClosedTrueAfterResetPromisedNonexistant) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_REFUSED_STREAM));
-  session_->ResetPromised(promised_stream_id_, QUIC_REFUSED_STREAM);
-  EXPECT_TRUE(session_->IsClosedStream(promised_stream_id_));
-}
-
-TEST_P(QuicSpdyClientSessionTest, OnInitialHeadersCompleteIsPush) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-  session_->GetOrCreateStream(promised_stream_id_);
-  EXPECT_TRUE(session_->HandlePromised(associated_stream_id_,
-                                       promised_stream_id_, push_promise_));
-  EXPECT_NE(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_NE(session_->GetPromisedStream(promised_stream_id_), nullptr);
-  EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr);
-
-  session_->OnInitialHeadersComplete(promised_stream_id_, Http2HeaderBlock());
-}
-
-TEST_P(QuicSpdyClientSessionTest, OnInitialHeadersCompleteIsNotPush) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-  session_->CreateOutgoingBidirectionalStream();
-  session_->OnInitialHeadersComplete(promised_stream_id_, Http2HeaderBlock());
-}
-
-TEST_P(QuicSpdyClientSessionTest, DeletePromised) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-  session_->GetOrCreateStream(promised_stream_id_);
-  EXPECT_TRUE(session_->HandlePromised(associated_stream_id_,
-                                       promised_stream_id_, push_promise_));
-  QuicClientPromisedInfo* promised =
-      session_->GetPromisedById(promised_stream_id_);
-  EXPECT_NE(promised, nullptr);
-  EXPECT_NE(session_->GetPromisedStream(promised_stream_id_), nullptr);
-  EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr);
-
-  session_->DeletePromised(promised);
-  EXPECT_EQ(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_EQ(session_->GetPromisedByUrl(promise_url_), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, ResetPromised) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-  session_->GetOrCreateStream(promised_stream_id_);
-  EXPECT_TRUE(session_->HandlePromised(associated_stream_id_,
-                                       promised_stream_id_, push_promise_));
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_STREAM_PEER_GOING_AWAY));
-  session_->ResetStream(promised_stream_id_, QUIC_STREAM_PEER_GOING_AWAY);
-  QuicClientPromisedInfo* promised =
-      session_->GetPromisedById(promised_stream_id_);
-  EXPECT_NE(promised, nullptr);
-  EXPECT_NE(session_->GetPromisedByUrl(promise_url_), nullptr);
-  EXPECT_EQ(session_->GetPromisedStream(promised_stream_id_), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, PushPromiseInvalidMethod) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  session_->CreateOutgoingBidirectionalStream();
-
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_INVALID_PROMISE_METHOD));
-
-  push_promise_[":method"] = "POST";
-  EXPECT_FALSE(session_->HandlePromised(associated_stream_id_,
-                                        promised_stream_id_, push_promise_));
-
-  EXPECT_EQ(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_EQ(session_->GetPromisedByUrl(promise_url_), nullptr);
-}
-
-TEST_P(QuicSpdyClientSessionTest, PushPromiseInvalidHost) {
-  // Initialize crypto before the client session will create a stream.
-  CompleteCryptoHandshake();
-
-  session_->CreateOutgoingBidirectionalStream();
-
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(promised_stream_id_, QUIC_INVALID_PROMISE_URL));
-
-  push_promise_[":authority"] = "";
-  EXPECT_FALSE(session_->HandlePromised(associated_stream_id_,
-                                        promised_stream_id_, push_promise_));
-
-  EXPECT_EQ(session_->GetPromisedById(promised_stream_id_), nullptr);
-  EXPECT_EQ(session_->GetPromisedByUrl(promise_url_), nullptr);
-}
-
 TEST_P(QuicSpdyClientSessionTest,
        TryToCreateServerInitiatedBidirectionalStream) {
   if (VersionHasIetfQuicFrames(connection_->transport_version())) {
diff --git a/quiche/quic/core/http/quic_spdy_client_stream.cc b/quiche/quic/core/http/quic_spdy_client_stream.cc
index a962669..33e6dda 100644
--- a/quiche/quic/core/http/quic_spdy_client_stream.cc
+++ b/quiche/quic/core/http/quic_spdy_client_stream.cc
@@ -8,7 +8,6 @@
 
 #include "absl/strings/str_cat.h"
 #include "absl/strings/string_view.h"
-#include "quiche/quic/core/http/quic_client_promised_info.h"
 #include "quiche/quic/core/http/quic_spdy_client_session.h"
 #include "quiche/quic/core/http/spdy_utils.h"
 #include "quiche/quic/core/http/web_transport_http3.h"
@@ -120,8 +119,6 @@
 
   ConsumeHeaderList();
   QUIC_DVLOG(1) << "headers complete for stream " << id();
-
-  session_->OnInitialHeadersComplete(id(), response_headers_);
 }
 
 void QuicSpdyClientStream::OnTrailingHeadersComplete(
diff --git a/quiche/quic/core/quic_constants.h b/quiche/quic/core/quic_constants.h
index aa73535..5126040 100644
--- a/quiche/quic/core/quic_constants.h
+++ b/quiche/quic/core/quic_constants.h
@@ -183,13 +183,6 @@
 // of available streams is 10 times the limit on the number of open streams.
 inline constexpr int kMaxAvailableStreamsMultiplier = 10;
 
-// Track the number of promises that are not yet claimed by a
-// corresponding get.  This must be smaller than
-// kMaxAvailableStreamsMultiplier, because RST on a promised stream my
-// create available streams entries.
-inline constexpr int kMaxPromisedStreamsMultiplier =
-    kMaxAvailableStreamsMultiplier - 1;
-
 // The 1st PTO is armed with max of earliest in flight sent time + PTO
 // delay and kFirstPtoSrttMultiplier * srtt from last in flight packet.
 inline constexpr float kFirstPtoSrttMultiplier = 1.5;