Bug 1399280 - Use pair->Size() for nvFIFO::AddElement, like in RemoveElement. - r=mcmanus draft
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 12 Sep 2017 15:53:16 -0700
changeset 663348 fb465489043f1784b2e94b3bd581d057b74c4df9
parent 659233 973e8b890a62aee4b3170558ac3b608928162ef6
child 731190 5ea1c3430ffeee56094809a189e34c5c5109957c
push id79421
push userbmo:jgilbert@mozilla.com
push dateTue, 12 Sep 2017 22:53:28 +0000
reviewersmcmanus
bugs1399280
milestone57.0a1
Bug 1399280 - Use pair->Size() for nvFIFO::AddElement, like in RemoveElement. - r=mcmanus MozReview-Commit-ID: 7YvsmMKUF2
netwerk/protocol/http/Http2Compression.cpp
--- a/netwerk/protocol/http/Http2Compression.cpp
+++ b/netwerk/protocol/http/Http2Compression.cpp
@@ -204,18 +204,18 @@ nvFIFO::nvFIFO()
 nvFIFO::~nvFIFO()
 {
   Clear();
 }
 
 void
 nvFIFO::AddElement(const nsCString &name, const nsCString &value)
 {
-  mByteCount += name.Length() + value.Length() + 32;
   nvPair *pair = new nvPair(name, value);
+  mByteCount += pair->Size();
   mTable.PushFront(pair);
 }
 
 void
 nvFIFO::AddElement(const nsCString &name)
 {
   AddElement(name, EmptyCString());
 }