Bug 1019918 - Remove pushed stream from SpdyPushCache when cleaning it up. r=mcmanus
authorNicholas Hurley <hurley@todesschaf.org>
Wed, 04 Jun 2014 15:37:00 -0400
changeset 207504 d717efc44fd31b716e3b877c503d555f4a47aa7c
parent 207394 31c707eb3a4b5e747521aadd1eade1284bb9a8e9
child 207505 d15632d881261b2d3a6225b30c4e84c0cb0eb5a9
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1019918
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1019918 - Remove pushed stream from SpdyPushCache when cleaning it up. r=mcmanus
netwerk/protocol/http/Http2Session.cpp
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -930,18 +930,32 @@ Http2Session::CleanupStream(Http2Stream 
 
   CloseStream(aStream, aResult);
 
   // Remove the stream from the ID hash table and, if an even id, the pushed
   // table too.
   uint32_t id = aStream->StreamID();
   if (id > 0) {
     mStreamIDHash.Remove(id);
-    if (!(id & 1))
+    if (!(id & 1)) {
       mPushedStreams.RemoveElement(aStream);
+      Http2PushedStream *pushStream = static_cast<Http2PushedStream *>(aStream);
+      nsAutoCString hashKey;
+      pushStream->GetHashKey(hashKey);
+      nsILoadGroupConnectionInfo *loadGroupCI = aStream->LoadGroupConnectionInfo();
+      if (loadGroupCI) {
+        SpdyPushCache *cache = nullptr;
+        loadGroupCI->GetSpdyPushCache(&cache);
+        if (cache) {
+          Http2PushedStream *trash = cache->RemovePushedStreamHttp2(hashKey);
+          LOG3(("Http2Session::CleanupStream %p aStream=%p pushStream=%p trash=%p",
+                this, aStream, pushStream, trash));
+        }
+      }
+    }
   }
 
   RemoveStreamFromQueues(aStream);
 
   // removing from the stream transaction hash will
   // delete the Http2Stream and drop the reference to
   // its transaction
   mStreamTransactionHash.Remove(aStream->Transaction());