bug 871289 [2 of 2] fix trailing whitespace in netwerk/protocol/http/* r=jduell
authorPatrick McManus <mcmanus@ducksong.com>
Thu, 16 May 2013 09:30:42 -0400
changeset 132081 c87ddaff7aa4c8c432093fecb807b6b5e9cf5fc1
parent 132080 7400723d23bc45e3f57f776047fba23e4632fc2f
child 132082 9bfd469a26df5e9d3116689ed26d6bdaaa6b93cc
push id28105
push usermcmanus@ducksong.com
push dateThu, 16 May 2013 13:31:04 +0000
treeherdermozilla-inbound@c87ddaff7aa4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs871289
milestone24.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 871289 [2 of 2] fix trailing whitespace in netwerk/protocol/http/* r=jduell
netwerk/protocol/http/ASpdySession.cpp
netwerk/protocol/http/ConnectionDiagnostics.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParentListener.cpp
netwerk/protocol/http/NullHttpTransaction.cpp
netwerk/protocol/http/PHttpChannel.ipdl
netwerk/protocol/http/README
netwerk/protocol/http/SpdySession2.cpp
netwerk/protocol/http/SpdySession2.h
netwerk/protocol/http/SpdySession3.cpp
netwerk/protocol/http/SpdySession3.h
netwerk/protocol/http/SpdyStream2.cpp
netwerk/protocol/http/SpdyStream2.h
netwerk/protocol/http/SpdyStream3.cpp
netwerk/protocol/http/SpdyStream3.h
netwerk/protocol/http/nsAHttpTransaction.h
netwerk/protocol/http/nsHttp.cpp
netwerk/protocol/http/nsHttpAtomList.h
netwerk/protocol/http/nsHttpAuthCache.cpp
netwerk/protocol/http/nsHttpAuthCache.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/protocol/http/nsHttpChannelAuthProvider.h
netwerk/protocol/http/nsHttpChunkedDecoder.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpConnection.h
netwerk/protocol/http/nsHttpConnectionInfo.h
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpConnectionMgr.h
netwerk/protocol/http/nsHttpDigestAuth.cpp
netwerk/protocol/http/nsHttpHandler.h
netwerk/protocol/http/nsHttpHeaderArray.cpp
netwerk/protocol/http/nsHttpHeaderArray.h
netwerk/protocol/http/nsHttpNTLMAuth.cpp
netwerk/protocol/http/nsHttpPipeline.cpp
netwerk/protocol/http/nsHttpPipeline.h
netwerk/protocol/http/nsHttpRequestHead.cpp
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsHttpResponseHead.h
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
netwerk/protocol/http/nsIHttpActivityObserver.idl
netwerk/protocol/http/nsIHttpAuthManager.idl
netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
netwerk/protocol/http/nsIHttpAuthenticator.idl
netwerk/protocol/http/nsIHttpChannel.idl
netwerk/protocol/http/nsIHttpChannelInternal.idl
netwerk/protocol/http/nsIHttpEventSink.idl
netwerk/protocol/http/nsIHttpProtocolHandler.idl
--- a/netwerk/protocol/http/ASpdySession.cpp
+++ b/netwerk/protocol/http/ASpdySession.cpp
@@ -29,17 +29,17 @@ ASpdySession::NewSpdySession(uint32_t ve
              "Unsupported spdy version");
 
   // Don't do a runtime check of IsSpdyV?Enabled() here because pref value
   // may have changed since starting negotiation. The selected protocol comes
   // from a list provided in the SERVER HELLO filtered by our acceptable
   // versions, so there is no risk of the server ignoring our prefs.
 
   Telemetry::Accumulate(Telemetry::SPDY_VERSION2, version);
-    
+
   if (version == SpdyInformation::SPDY_VERSION_2)
     return new SpdySession2(aTransaction, aTransport, aPriority);
 
   return new SpdySession3(aTransaction, aTransport, aPriority);
 }
 
 SpdyInformation::SpdyInformation()
 {
--- a/netwerk/protocol/http/ConnectionDiagnostics.cpp
+++ b/netwerk/protocol/http/ConnectionDiagnostics.cpp
@@ -32,18 +32,18 @@ nsHttpConnectionMgr::OnMsgPrintDiagnosti
     return;
 
   mLogData.AppendPrintf("HTTP Connection Diagnostics\n---------------------\n");
   mLogData.AppendPrintf("IsSpdyEnabled() = %d\n", gHttpHandler->IsSpdyEnabled());
   mLogData.AppendPrintf("MaxSocketCount() = %d\n", gHttpHandler->MaxSocketCount());
   mLogData.AppendPrintf("mNumActiveConns = %d\n", mNumActiveConns);
   mLogData.AppendPrintf("mNumIdleConns = %d\n", mNumIdleConns);
 
-  mCT.Enumerate(PrintDiagnosticsCB, this);    
-    
+  mCT.Enumerate(PrintDiagnosticsCB, this);
+
   consoleService->LogStringMessage(NS_ConvertUTF8toUTF16(mLogData).Data());
   mLogData.Truncate();
 }
 
 PLDHashOperator
 nsHttpConnectionMgr::PrintDiagnosticsCB(const nsACString &key,
                                         nsAutoPtr<nsConnectionEntry> &ent,
                                         void *closure)
@@ -86,40 +86,40 @@ nsHttpConnectionMgr::PrintDiagnosticsCB(
   for (i = 0; i < ent->mHalfOpens.Length(); ++i) {
     self->mLogData.AppendPrintf("   :: Half Open #%u\n", i);
     ent->mHalfOpens[i]->PrintDiagnostics(self->mLogData);
   }
   for (i = 0; i < ent->mPendingQ.Length(); ++i) {
     self->mLogData.AppendPrintf("   :: Pending Transaction #%u\n", i);
     ent->mPendingQ[i]->PrintDiagnostics(self->mLogData);
   }
-    
+
   return PL_DHASH_NEXT;
 }
 
 void
 nsHttpConnectionMgr::nsHalfOpenSocket::PrintDiagnostics(nsCString &log)
 {
   log.AppendPrintf("     has connected = %d, isSpeculative = %d\n",
                    HasConnected(), IsSpeculative());
 
   TimeStamp now = TimeStamp::Now();
-    
+
   if (mPrimarySynStarted.IsNull())
     log.AppendPrintf("    primary not started\n");
   else
     log.AppendPrintf("    primary started %.2fms ago\n",
                      (now - mPrimarySynStarted).ToMilliseconds());
 
   if (mBackupSynStarted.IsNull())
     log.AppendPrintf("    backup not started\n");
   else
     log.AppendPrintf("    backup started %.2f ago\n",
                      (now - mBackupSynStarted).ToMilliseconds());
-    
+
   log.AppendPrintf("    primary transport %d, backup transport %d\n",
                    !!mSocketTransport.get(), !!mBackupTransport.get());
 }
 
 void
 nsHttpConnection::PrintDiagnostics(nsCString &log)
 {
   log.AppendPrintf("    CanDirectlyActivate = %d\n", CanDirectlyActivate());
@@ -137,58 +137,58 @@ nsHttpConnection::PrintDiagnostics(nsCSt
                    !!mTransaction.get(), !!mSpdySession.get());
 
   PRIntervalTime now = PR_IntervalNow();
   log.AppendPrintf("    time since last read = %ums\n",
                    PR_IntervalToMilliseconds(now - mLastReadTime));
 
   log.AppendPrintf("    max-read/read/written %lld/%lld/%lld\n",
                    mMaxBytesRead, mTotalBytesRead, mTotalBytesWritten);
-    
+
   log.AppendPrintf("    rtt = %ums\n", PR_IntervalToMilliseconds(mRtt));
 
   log.AppendPrintf("    idlemonitoring = %d transactionCount=%d\n",
                    mIdleMonitoring, mHttp1xTransactionCount);
-    
+
   log.AppendPrintf("    supports pipeline = %d classification = 0x%x\n",
                    mSupportsPipelining, mClassification);
-    
+
   if (mSpdySession)
     mSpdySession->PrintDiagnostics(log);
 }
 
 void
 SpdySession3::PrintDiagnostics(nsCString &log)
 {
   log.AppendPrintf("     ::: SPDY VERSION 3\n");
   log.AppendPrintf("     shouldgoaway = %d mClosed = %d CanReuse = %d nextID=0x%X\n",
                    mShouldGoAway, mClosed, CanReuse(), mNextStreamID);
 
   log.AppendPrintf("     concurrent = %d maxconcurrent = %d\n",
                    mConcurrent, mMaxConcurrent);
-    
+
   log.AppendPrintf("     roomformorestreams = %d roomformoreconcurrent = %d\n",
                    RoomForMoreStreams(), RoomForMoreConcurrent());
-    
+
   log.AppendPrintf("     transactionHashCount = %d streamIDHashCount = %d\n",
                    mStreamTransactionHash.Count(),
                    mStreamIDHash.Count());
 
   log.AppendPrintf("     Queued Stream Size = %d\n", mQueuedStreams.GetSize());
 
-  PRIntervalTime now = PR_IntervalNow();    
+  PRIntervalTime now = PR_IntervalNow();
   log.AppendPrintf("     Ping Threshold = %ums next ping id = 0x%X\n",
                    PR_IntervalToMilliseconds(mPingThreshold),
                    mNextPingID);
   log.AppendPrintf("     Ping Timeout = %ums\n",
                    PR_IntervalToMilliseconds(gHttpHandler->SpdyPingTimeout()));
   log.AppendPrintf("     Idle for Any Activity (ping) = %ums\n",
-                   PR_IntervalToMilliseconds(now - mLastReadEpoch));    
+                   PR_IntervalToMilliseconds(now - mLastReadEpoch));
   log.AppendPrintf("     Idle for Data Activity = %ums\n",
-                   PR_IntervalToMilliseconds(now - mLastDataReadEpoch));    
+                   PR_IntervalToMilliseconds(now - mLastDataReadEpoch));
   if (mPingSentEpoch)
     log.AppendPrintf("     Ping Outstanding (ping) = %ums, expired = %d\n",
                      PR_IntervalToMilliseconds(now - mPingSentEpoch),
                      now - mPingSentEpoch >= gHttpHandler->SpdyPingTimeout());
   else
     log.AppendPrintf("     No Ping Outstanding\n");
 }
 
@@ -196,36 +196,36 @@ void
 SpdySession2::PrintDiagnostics(nsCString &log)
 {
   log.AppendPrintf("     ::: SPDY VERSION 2\n");
   log.AppendPrintf("     shouldgoaway = %d mClosed = %d CanReuse = %d nextID=0x%X\n",
                    mShouldGoAway, mClosed, CanReuse(), mNextStreamID);
 
   log.AppendPrintf("     concurrent = %d maxconcurrent = %d\n",
                    mConcurrent, mMaxConcurrent);
-    
+
   log.AppendPrintf("     roomformorestreams = %d roomformoreconcurrent = %d\n",
                    RoomForMoreStreams(), RoomForMoreConcurrent());
-    
+
   log.AppendPrintf("     transactionHashCount = %d streamIDHashCount = %d\n",
                    mStreamTransactionHash.Count(),
                    mStreamIDHash.Count());
 
   log.AppendPrintf("     Queued Stream Size = %d\n", mQueuedStreams.GetSize());
 
-  PRIntervalTime now = PR_IntervalNow();    
+  PRIntervalTime now = PR_IntervalNow();
   log.AppendPrintf("     Ping Threshold = %ums next ping id = 0x%X\n",
                    PR_IntervalToMilliseconds(mPingThreshold),
                    mNextPingID);
   log.AppendPrintf("     Ping Timeout = %ums\n",
                    PR_IntervalToMilliseconds(gHttpHandler->SpdyPingTimeout()));
   log.AppendPrintf("     Idle for Any Activity (ping) = %ums\n",
-                   PR_IntervalToMilliseconds(now - mLastReadEpoch));    
+                   PR_IntervalToMilliseconds(now - mLastReadEpoch));
   log.AppendPrintf("     Idle for Data Activity = %ums\n",
-                   PR_IntervalToMilliseconds(now - mLastDataReadEpoch));    
+                   PR_IntervalToMilliseconds(now - mLastDataReadEpoch));
   if (mPingSentEpoch)
     log.AppendPrintf("     Ping Outstanding (ping) = %ums, expired = %d\n",
                      PR_IntervalToMilliseconds(now - mPingSentEpoch),
                      now - mPingSentEpoch >= gHttpHandler->SpdyPingTimeout());
   else
     log.AppendPrintf("     No Ping Outstanding\n");
 }
 
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -329,17 +329,17 @@ HttpBaseChannel::SetContentType(const ns
       mResponseHead->SetContentCharset(charsetBuf);
 
   } else {
     // We are being given a content-type hint.
     bool dummy;
     net_ParseContentType(aContentType, mContentTypeHint, mContentCharsetHint,
                          &dummy);
   }
-  
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::GetContentCharset(nsACString& aContentCharset)
 {
   if (!mResponseHead)
     return NS_ERROR_NOT_AVAILABLE;
@@ -510,37 +510,37 @@ HttpBaseChannel::SetUploadStream(nsIInpu
 
 NS_IMETHODIMP
 HttpBaseChannel::ExplicitSetUploadStream(nsIInputStream *aStream,
                                        const nsACString &aContentType,
                                        int64_t aContentLength,
                                        const nsACString &aMethod,
                                        bool aStreamHasHeaders)
 {
-  // Ensure stream is set and method is valid 
+  // Ensure stream is set and method is valid
   NS_ENSURE_TRUE(aStream, NS_ERROR_FAILURE);
 
   if (aContentLength < 0 && !aStreamHasHeaders) {
     nsresult rv = aStream->Available(reinterpret_cast<uint64_t*>(&aContentLength));
     if (NS_FAILED(rv) || aContentLength < 0) {
       NS_ERROR("unable to determine content length");
       return NS_ERROR_FAILURE;
     }
   }
 
   nsresult rv = SetRequestMethod(aMethod);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!aStreamHasHeaders) {
-    // SetRequestHeader propagates headers to chrome if HttpChannelChild 
+    // SetRequestHeader propagates headers to chrome if HttpChannelChild
     nsAutoCString contentLengthStr;
     contentLengthStr.AppendInt(aContentLength);
-    SetRequestHeader(NS_LITERAL_CSTRING("Content-Length"), contentLengthStr, 
+    SetRequestHeader(NS_LITERAL_CSTRING("Content-Length"), contentLengthStr,
                      false);
-    SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), aContentType, 
+    SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), aContentType,
                      false);
   }
 
   mUploadStreamHasHeaders = aStreamHasHeaders;
   mUploadStream = aStream;
   return NS_OK;
 }
 
@@ -649,17 +649,17 @@ HttpBaseChannel::ApplyContentConversions
 
 NS_IMETHODIMP
 HttpBaseChannel::GetContentEncodings(nsIUTF8StringEnumerator** aEncodings)
 {
   if (!mResponseHead) {
     *aEncodings = nullptr;
     return NS_OK;
   }
-    
+
   const char *encoding = mResponseHead->PeekHeader(nsHttp::Content_Encoding);
   if (!encoding) {
     *aEncodings = nullptr;
     return NS_OK;
   }
   nsContentEncodings* enumerator = new nsContentEncodings(this, encoding);
   NS_ADDREF(*aEncodings = enumerator);
   return NS_OK;
@@ -673,17 +673,17 @@ HttpBaseChannel::nsContentEncodings::nsC
                                                         const char* aEncodingHeader)
   : mEncodingHeader(aEncodingHeader)
   , mChannel(aChannel)
   , mReady(false)
 {
   mCurEnd = aEncodingHeader + strlen(aEncodingHeader);
   mCurStart = mCurEnd;
 }
-    
+
 HttpBaseChannel::nsContentEncodings::~nsContentEncodings()
 {
 }
 
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsContentEncodings::nsISimpleEnumerator
 //-----------------------------------------------------------------------------
 
@@ -725,29 +725,29 @@ HttpBaseChannel::nsContentEncodings::Get
 
   if (!haveType) {
     encoding.BeginReading(start);
     if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("compress"), start, end)) {
       aNextEncoding.AssignLiteral(APPLICATION_COMPRESS);
       haveType = true;
     }
   }
-    
+
   if (!haveType) {
     encoding.BeginReading(start);
     if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("deflate"), start, end)) {
       aNextEncoding.AssignLiteral(APPLICATION_ZIP);
       haveType = true;
     }
   }
 
   // Prepare to fetch the next encoding
   mCurEnd = mCurStart;
   mReady = false;
-  
+
   if (haveType)
     return NS_OK;
 
   NS_WARNING("Unknown encoding type");
   return NS_ERROR_FAILURE;
 }
 
 //-----------------------------------------------------------------------------
@@ -759,47 +759,47 @@ NS_IMPL_ISUPPORTS1(HttpBaseChannel::nsCo
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsContentEncodings <private>
 //-----------------------------------------------------------------------------
 
 nsresult
 HttpBaseChannel::nsContentEncodings::PrepareForNext(void)
 {
   MOZ_ASSERT(mCurStart == mCurEnd, "Indeterminate state");
-    
+
   // At this point both mCurStart and mCurEnd point to somewhere
   // past the end of the next thing we want to return
-    
+
   while (mCurEnd != mEncodingHeader) {
     --mCurEnd;
     if (*mCurEnd != ',' && !nsCRT::IsAsciiSpace(*mCurEnd))
       break;
   }
   if (mCurEnd == mEncodingHeader)
     return NS_ERROR_NOT_AVAILABLE; // no more encodings
   ++mCurEnd;
-        
+
   // At this point mCurEnd points to the first char _after_ the
   // header we want.  Furthermore, mCurEnd - 1 != mEncodingHeader
-    
+
   mCurStart = mCurEnd - 1;
   while (mCurStart != mEncodingHeader &&
          *mCurStart != ',' && !nsCRT::IsAsciiSpace(*mCurStart))
     --mCurStart;
   if (*mCurStart == ',' || nsCRT::IsAsciiSpace(*mCurStart))
     ++mCurStart; // we stopped because of a weird char, so move up one
-        
+
   // At this point mCurStart and mCurEnd bracket the encoding string
   // we want.  Check that it's not "identity"
   if (Substring(mCurStart, mCurEnd).Equals("identity",
                                            nsCaseInsensitiveCStringComparator())) {
     mCurEnd = mCurStart;
     return PrepareForNext();
   }
-        
+
   mReady = true;
   return NS_OK;
 }
 
 
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsIHttpChannel
 //-----------------------------------------------------------------------------
@@ -866,29 +866,29 @@ HttpBaseChannel::SetReferrer(nsIURI *ref
 
   //
   // Strip off "wyciwyg://123/" from wyciwyg referrers.
   //
   // XXX this really belongs elsewhere since wyciwyg URLs aren't part of necko.
   //     perhaps some sort of generic nsINestedURI could be used.  then, if an URI
   //     fails the whitelist test, then we could check for an inner URI and try
   //     that instead.  though, that might be too automatic.
-  // 
+  //
   rv = referrer->SchemeIs("wyciwyg", &match);
   if (NS_FAILED(rv)) return rv;
   if (match) {
     nsAutoCString path;
     rv = referrer->GetPath(path);
     if (NS_FAILED(rv)) return rv;
 
     uint32_t pathLength = path.Length();
     if (pathLength <= 2) return NS_ERROR_FAILURE;
 
     // Path is of the form "//123/http://foo/bar", with a variable number of digits.
-    // To figure out where the "real" URL starts, search path for a '/', starting at 
+    // To figure out where the "real" URL starts, search path for a '/', starting at
     // the third character.
     int32_t slashIndex = path.FindChar('/', 2);
     if (slashIndex == kNotFound) return NS_ERROR_FAILURE;
 
     // Get the charset of the original URI so we can pass it to our fixed up URI.
     nsAutoCString charset;
     referrer->GetOriginCharset(charset);
 
@@ -996,17 +996,17 @@ HttpBaseChannel::SetRequestHeader(const 
   const nsCString &flatValue  = PromiseFlatCString(aValue);
 
   LOG(("HttpBaseChannel::SetRequestHeader [this=%p header=\"%s\" value=\"%s\" merge=%u]\n",
       this, flatHeader.get(), flatValue.get(), aMerge));
 
   // Header names are restricted to valid HTTP tokens.
   if (!nsHttp::IsValidToken(flatHeader))
     return NS_ERROR_INVALID_ARG;
-  
+
   // Header values MUST NOT contain line-breaks.  RFC 2616 technically
   // permits CTL characters, including CR and LF, in header values provided
   // they are quoted.  However, this can lead to problems if servers do not
   // interpret quoted strings properly.  Disallowing CR and LF here seems
   // reasonable and keeps things simple.  We also disallow a null byte.
   if (flatValue.FindCharInSet("\r\n") != kNotFound ||
       flatValue.Length() != strlen(flatValue.get()))
     return NS_ERROR_INVALID_ARG;
@@ -1035,31 +1035,31 @@ HttpBaseChannel::GetResponseHeader(const
   nsHttpAtom atom = nsHttp::ResolveAtom(header);
   if (!atom)
     return NS_ERROR_NOT_AVAILABLE;
 
   return mResponseHead->GetHeader(atom, value);
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::SetResponseHeader(const nsACString& header, 
-                                   const nsACString& value, 
+HttpBaseChannel::SetResponseHeader(const nsACString& header,
+                                   const nsACString& value,
                                    bool merge)
 {
   LOG(("HttpBaseChannel::SetResponseHeader [this=%p header=\"%s\" value=\"%s\" merge=%u]\n",
       this, PromiseFlatCString(header).get(), PromiseFlatCString(value).get(), merge));
 
   if (!mResponseHead)
     return NS_ERROR_NOT_AVAILABLE;
 
   nsHttpAtom atom = nsHttp::ResolveAtom(header);
   if (!atom)
     return NS_ERROR_NOT_AVAILABLE;
 
-  // these response headers must not be changed 
+  // these response headers must not be changed
   if (atom == nsHttp::Content_Type ||
       atom == nsHttp::Content_Length ||
       atom == nsHttp::Content_Encoding ||
       atom == nsHttp::Trailer ||
       atom == nsHttp::Transfer_Encoding)
     return NS_ERROR_ILLEGAL_VALUE;
 
   mResponseHeadersModified = true;
@@ -1342,17 +1342,17 @@ HttpBaseChannel::GetRemotePort(int32_t* 
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::HTTPUpgrade(const nsACString &aProtocolName,
                              nsIHttpUpgradeListener *aListener)
 {
     NS_ENSURE_ARG(!aProtocolName.IsEmpty());
     NS_ENSURE_ARG_POINTER(aListener);
-    
+
     mUpgradeProtocol = aProtocolName;
     mUpgradeProtocolCallback = aListener;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::GetAllowSpdy(bool *aAllowSpdy)
 {
@@ -1519,17 +1519,17 @@ HttpBaseChannel::DoNotifyListener()
 
 void
 HttpBaseChannel::AddCookiesToRequest()
 {
   if (mLoadFlags & LOAD_ANONYMOUS) {
     return;
   }
 
-  bool useCookieService = 
+  bool useCookieService =
     (XRE_GetProcessType() == GeckoProcessType_Default);
   nsXPIDLCString cookie;
   if (useCookieService) {
     nsICookieService *cs = gHttpHandler->GetCookieService();
     if (cs) {
       cs->GetCookieStringFromHttp(mURI,
                                   nullptr,
                                   this, getter_Copies(cookie));
@@ -1556,17 +1556,17 @@ CopyProperties(const nsAString& aKey, ns
 {
   nsIWritablePropertyBag* bag = static_cast<nsIWritablePropertyBag*>
                                            (aClosure);
   bag->SetProperty(aKey, aData);
   return PL_DHASH_NEXT;
 }
 
 nsresult
-HttpBaseChannel::SetupReplacementChannel(nsIURI       *newURI, 
+HttpBaseChannel::SetupReplacementChannel(nsIURI       *newURI,
                                          nsIChannel   *newChannel,
                                          bool          preserveMethod)
 {
   LOG(("HttpBaseChannel::SetupReplacementChannel "
      "[this=%p newChannel=%p preserveMethod=%d]",
      this, newChannel, preserveMethod));
   uint32_t newLoadFlags = mLoadFlags | LOAD_REPLACE;
   // if the original channel was using SSL and this channel is not using
@@ -1578,17 +1578,17 @@ HttpBaseChannel::SetupReplacementChannel
   bool usingSSL = false;
   nsresult rv = mURI->SchemeIs("https", &usingSSL);
   if (NS_SUCCEEDED(rv) && usingSSL)
     newLoadFlags &= ~INHIBIT_PERSISTENT_CACHING;
 
   // Do not pass along LOAD_CHECK_OFFLINE_CACHE
   newLoadFlags &= ~nsICachingChannel::LOAD_CHECK_OFFLINE_CACHE;
 
-  newChannel->SetLoadGroup(mLoadGroup); 
+  newChannel->SetLoadGroup(mLoadGroup);
   newChannel->SetNotificationCallbacks(mCallbacks);
   newChannel->SetLoadFlags(newLoadFlags);
 
   // Try to preserve the privacy bit if it has been overridden
   if (mPrivateBrowsingOverriden) {
     nsCOMPtr<nsIPrivateBrowsingChannel> newPBChannel =
       do_QueryInterface(newChannel);
     if (newPBChannel) {
@@ -1637,18 +1637,18 @@ HttpBaseChannel::SetupReplacementChannel
           if (clen) {
             uploadChannel->SetUploadStream(mUploadStream,
                                            nsDependentCString(ctype),
                                            nsCRT::atoll(clen));
           }
         }
       }
     }
-    // since preserveMethod is true, we need to ensure that the appropriate 
-    // request method gets set on the channel, regardless of whether or not 
+    // since preserveMethod is true, we need to ensure that the appropriate
+    // request method gets set on the channel, regardless of whether or not
     // we set the upload stream above. This means SetRequestMethod() will
     // be called twice if ExplicitSetUploadStream() gets called above.
 
     httpChannel->SetRequestMethod(nsDependentCString(mRequestHead.Method()));
   }
   // convey the referrer if one was used for this channel to the next one
   if (mReferrer)
     httpChannel->SetReferrer(mReferrer);
@@ -1676,17 +1676,17 @@ HttpBaseChannel::SetupReplacementChannel
     // if there is a chain of keys for redirect-responses we transfer it to
     // the new channel (see bug #561276)
     if (mRedirectedCachekeys) {
         LOG(("HttpBaseChannel::SetupReplacementChannel "
              "[this=%p] transferring chain of redirect cache-keys", this));
         httpInternal->SetCacheKeysRedirectChain(mRedirectedCachekeys.forget());
     }
   }
-  
+
   // transfer application cache information
   nsCOMPtr<nsIApplicationCacheChannel> appCacheChannel =
     do_QueryInterface(newChannel);
   if (appCacheChannel) {
     appCacheChannel->SetApplicationCache(mApplicationCache);
     appCacheChannel->SetInheritApplicationCache(mInheritApplicationCache);
     // We purposely avoid transfering mChooseApplicationCache.
   }
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -34,17 +34,17 @@
 #include "PrivateBrowsingChannel.h"
 #include "mozilla/net/DNS.h"
 
 namespace mozilla {
 namespace net {
 
 /*
  * This class is a partial implementation of nsIHttpChannel.  It contains code
- * shared by nsHttpChannel and HttpChannelChild. 
+ * shared by nsHttpChannel and HttpChannelChild.
  * - Note that this class has nothing to do with nsBaseChannel, which is an
  *   earlier effort at a base class for channels that somehow never made it all
  *   the way to the HTTP channel.
  */
 class HttpBaseChannel : public nsHashPropertyBag
                       , public nsIEncodedChannel
                       , public nsIHttpChannel
                       , public nsIHttpChannelInternal
@@ -104,21 +104,21 @@ public:
   NS_IMETHOD GetContentEncodings(nsIUTF8StringEnumerator** aEncodings);
 
   // HttpBaseChannel::nsIHttpChannel
   NS_IMETHOD GetRequestMethod(nsACString& aMethod);
   NS_IMETHOD SetRequestMethod(const nsACString& aMethod);
   NS_IMETHOD GetReferrer(nsIURI **referrer);
   NS_IMETHOD SetReferrer(nsIURI *referrer);
   NS_IMETHOD GetRequestHeader(const nsACString& aHeader, nsACString& aValue);
-  NS_IMETHOD SetRequestHeader(const nsACString& aHeader, 
+  NS_IMETHOD SetRequestHeader(const nsACString& aHeader,
                               const nsACString& aValue, bool aMerge);
   NS_IMETHOD VisitRequestHeaders(nsIHttpHeaderVisitor *visitor);
   NS_IMETHOD GetResponseHeader(const nsACString &header, nsACString &value);
-  NS_IMETHOD SetResponseHeader(const nsACString& header, 
+  NS_IMETHOD SetResponseHeader(const nsACString& header,
                                const nsACString& value, bool merge);
   NS_IMETHOD VisitResponseHeaders(nsIHttpHeaderVisitor *visitor);
   NS_IMETHOD GetAllowPipelining(bool *value);
   NS_IMETHOD SetAllowPipelining(bool value);
   NS_IMETHOD GetRedirectionLimit(uint32_t *value);
   NS_IMETHOD SetRedirectionLimit(uint32_t value);
   NS_IMETHOD IsNoStoreResponse(bool *value);
   NS_IMETHOD IsNoCacheResponse(bool *value);
@@ -144,52 +144,52 @@ public:
   NS_IMETHOD GetRemoteAddress(nsACString& addr);
   NS_IMETHOD GetRemotePort(int32_t* port);
   NS_IMETHOD GetAllowSpdy(bool *aAllowSpdy);
   NS_IMETHOD SetAllowSpdy(bool aAllowSpdy);
   NS_IMETHOD GetLoadAsBlocking(bool *aLoadAsBlocking);
   NS_IMETHOD SetLoadAsBlocking(bool aLoadAsBlocking);
   NS_IMETHOD GetLoadUnblocked(bool *aLoadUnblocked);
   NS_IMETHOD SetLoadUnblocked(bool aLoadUnblocked);
-  
+
   inline void CleanRedirectCacheChainIfNecessary()
   {
       mRedirectedCachekeys = nullptr;
   }
   NS_IMETHOD HTTPUpgrade(const nsACString & aProtocolName,
-                         nsIHttpUpgradeListener *aListener); 
+                         nsIHttpUpgradeListener *aListener);
 
   // nsISupportsPriority
   NS_IMETHOD GetPriority(int32_t *value);
   NS_IMETHOD AdjustPriority(int32_t delta);
 
   // nsIResumableChannel
   NS_IMETHOD GetEntityID(nsACString& aEntityID);
 
   class nsContentEncodings : public nsIUTF8StringEnumerator
     {
     public:
         NS_DECL_ISUPPORTS
         NS_DECL_NSIUTF8STRINGENUMERATOR
 
         nsContentEncodings(nsIHttpChannel* aChannel, const char* aEncodingHeader);
         virtual ~nsContentEncodings();
-        
+
     private:
         nsresult PrepareForNext(void);
-        
+
         // We do not own the buffer.  The channel owns it.
         const char* mEncodingHeader;
         const char* mCurStart;  // points to start of current header
         const char* mCurEnd;  // points to end of current header
-        
+
         // Hold a ref to our channel so that it can't go away and take the
         // header with it.
         nsCOMPtr<nsIHttpChannel> mChannel;
-        
+
         bool mReady;
     };
 
     nsHttpResponseHead * GetResponseHead() const { return mResponseHead; }
     nsHttpRequestHead * GetRequestHead() { return &mRequestHead; }
 
     const NetAddr& GetSelfAddr() { return mSelfAddr; }
     const NetAddr& GetPeerAddr() { return mPeerAddr; }
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -184,18 +184,18 @@ class StartRequestEvent : public Channel
   , mCacheEntryAvailable(cacheEntryAvailable)
   , mCacheExpirationTime(cacheExpirationTime)
   , mCachedCharset(cachedCharset)
   , mSecurityInfoSerialization(securityInfoSerialization)
   , mSelfAddr(selfAddr)
   , mPeerAddr(peerAddr)
   {}
 
-  void Run() 
-  { 
+  void Run()
+  {
     mChild->OnStartRequest(mResponseHead, mUseResponseHead, mRequestHeaders,
                            mIsFromCache, mCacheEntryAvailable,
                            mCacheExpirationTime, mCachedCharset,
                            mSecurityInfoSerialization, mSelfAddr, mPeerAddr);
   }
  private:
   HttpChannelChild* mChild;
   nsHttpResponseHead mResponseHead;
@@ -205,17 +205,17 @@ class StartRequestEvent : public Channel
   bool mCacheEntryAvailable;
   uint32_t mCacheExpirationTime;
   nsCString mCachedCharset;
   nsCString mSecurityInfoSerialization;
   NetAddr mSelfAddr;
   NetAddr mPeerAddr;
 };
 
-bool 
+bool
 HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead,
                                      const bool& useResponseHead,
                                      const nsHttpHeaderArray& requestHeaders,
                                      const bool& isFromCache,
                                      const bool& cacheEntryAvailable,
                                      const uint32_t& cacheExpirationTime,
                                      const nsCString& cachedCharset,
                                      const nsCString& securityInfoSerialization,
@@ -232,17 +232,17 @@ HttpChannelChild::RecvOnStartRequest(con
   } else {
     OnStartRequest(responseHead, useResponseHead, requestHeaders, isFromCache,
                    cacheEntryAvailable, cacheExpirationTime, cachedCharset,
                    securityInfoSerialization, selfAddr, peerAddr);
   }
   return true;
 }
 
-void 
+void
 HttpChannelChild::OnStartRequest(const nsHttpResponseHead& responseHead,
                                  const bool& useResponseHead,
                                  const nsHttpHeaderArray& requestHeaders,
                                  const bool& isFromCache,
                                  const bool& cacheEntryAvailable,
                                  const uint32_t& cacheExpirationTime,
                                  const nsCString& cachedCharset,
                                  const nsCString& securityInfoSerialization,
@@ -250,17 +250,17 @@ HttpChannelChild::OnStartRequest(const n
                                  const NetAddr& peerAddr)
 {
   LOG(("HttpChannelChild::RecvOnStartRequest [this=%x]\n", this));
 
   if (useResponseHead && !mCanceled)
     mResponseHead = new nsHttpResponseHead(responseHead);
 
   if (!securityInfoSerialization.IsEmpty()) {
-    NS_DeserializeObject(securityInfoSerialization, 
+    NS_DeserializeObject(securityInfoSerialization,
                          getter_AddRefs(mSecurityInfo));
   }
 
   mIsFromCache = isFromCache;
   mCacheEntryAvailable = cacheEntryAvailable;
   mCacheExpirationTime = cacheExpirationTime;
   mCachedCharset = cachedCharset;
 
@@ -328,17 +328,17 @@ HttpChannelChild::RecvOnTransportAndData
                                          const uint64_t& progress,
                                          const uint64_t& progressMax,
                                          const nsCString& data,
                                          const uint64_t& offset,
                                          const uint32_t& count)
 {
   if (mEventQ.ShouldEnqueue()) {
     mEventQ.Enqueue(new TransportAndDataEvent(this, status, progress,
-                                              progressMax, data, offset, 
+                                              progressMax, data, offset,
                                               count));
   } else {
     OnTransportAndData(status, progress, progressMax, data, offset, count);
   }
   return true;
 }
 
 void
@@ -419,31 +419,31 @@ class StopRequestEvent : public ChannelE
   , mStatusCode(statusCode) {}
 
   void Run() { mChild->OnStopRequest(mStatusCode); }
  private:
   HttpChannelChild* mChild;
   nsresult mStatusCode;
 };
 
-bool 
+bool
 HttpChannelChild::RecvOnStopRequest(const nsresult& statusCode)
 {
   if (mEventQ.ShouldEnqueue()) {
     mEventQ.Enqueue(new StopRequestEvent(this, statusCode));
   } else {
     OnStopRequest(statusCode);
   }
   return true;
 }
 
-void 
+void
 HttpChannelChild::OnStopRequest(const nsresult& statusCode)
 {
-  LOG(("HttpChannelChild::OnStopRequest [this=%x status=%u]\n", 
+  LOG(("HttpChannelChild::OnStopRequest [this=%x status=%u]\n",
            this, statusCode));
 
   mIsPending = false;
 
   if (!mCanceled && NS_SUCCEEDED(mStatus))
     mStatus = statusCode;
 
   { // We must flush the queue before we Send__delete__
@@ -512,18 +512,18 @@ HttpChannelChild::OnProgress(const uint6
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink)
     GetCallback(mProgressSink);
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
   // block socket status event after Cancel or OnStopRequest has been called,
   // or if channel has LOAD_BACKGROUND set
-  if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending && 
-      !(mLoadFlags & LOAD_BACKGROUND)) 
+  if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending &&
+      !(mLoadFlags & LOAD_BACKGROUND))
   {
     if (progress > 0) {
       MOZ_ASSERT(progress <= progressMax, "unexpected progress values");
       mProgressSink->OnProgress(this, nullptr, progress, progressMax);
     }
   }
 }
 
@@ -563,18 +563,18 @@ HttpChannelChild::OnStatus(const nsresul
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink)
     GetCallback(mProgressSink);
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
   // block socket status event after Cancel or OnStopRequest has been called,
   // or if channel has LOAD_BACKGROUND set
-  if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending && 
-      !(mLoadFlags & LOAD_BACKGROUND)) 
+  if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending &&
+      !(mLoadFlags & LOAD_BACKGROUND))
   {
     nsAutoCString host;
     mURI->GetHost(host);
     mProgressSink->OnStatus(this, nullptr, status,
                             NS_ConvertUTF8toUTF16(host).get());
   }
 }
 
@@ -664,20 +664,20 @@ class Redirect1Event : public ChannelEve
                  const uint32_t& redirectFlags,
                  const nsHttpResponseHead& responseHead)
   : mChild(child)
   , mNewChannelId(newChannelId)
   , mNewURI(newURI)
   , mRedirectFlags(redirectFlags)
   , mResponseHead(responseHead) {}
 
-  void Run() 
-  { 
+  void Run()
+  {
     mChild->Redirect1Begin(mNewChannelId, mNewURI, mRedirectFlags,
-                           mResponseHead); 
+                           mResponseHead);
   }
  private:
   HttpChannelChild*   mChild;
   uint32_t            mNewChannelId;
   URIParams           mNewURI;
   uint32_t            mRedirectFlags;
   nsHttpResponseHead  mResponseHead;
 };
@@ -724,32 +724,32 @@ HttpChannelChild::Redirect1Begin(const u
   }
 
   // We won't get OnStartRequest, set cookies here.
   mResponseHead = new nsHttpResponseHead(responseHead);
   SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
 
   bool rewriteToGET = nsHttp::ShouldRewriteRedirectToGET(
                                mResponseHead->Status(), mRequestHead.Method());
-  
+
   rv = SetupReplacementChannel(uri, newChannel, !rewriteToGET);
   if (NS_FAILED(rv)) {
     // Veto redirect.  nsHttpChannel decides to cancel or continue.
     OnRedirectVerifyCallback(rv);
     return;
   }
 
   mRedirectChannelChild = do_QueryInterface(newChannel);
   if (mRedirectChannelChild) {
     mRedirectChannelChild->ConnectParent(newChannelId);
   } else {
     NS_ERROR("Redirecting to a protocol that doesn't support universal protocol redirect");
   }
 
-  rv = gHttpHandler->AsyncOnChannelRedirect(this, 
+  rv = gHttpHandler->AsyncOnChannelRedirect(this,
                                             newChannel,
                                             redirectFlags);
   if (NS_FAILED(rv))
     OnRedirectVerifyCallback(rv);
 }
 
 class Redirect3Event : public ChannelEvent
 {
@@ -820,17 +820,17 @@ HttpChannelChild::ConnectParent(uint32_t
 
   if (!SendConnectChannel(id))
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpChannelChild::CompleteRedirectSetup(nsIStreamListener *listener, 
+HttpChannelChild::CompleteRedirectSetup(nsIStreamListener *listener,
                                         nsISupports *aContext)
 {
   LOG(("HttpChannelChild::FinishRedirectSetup [this=%x]\n", this));
 
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
   /*
@@ -840,17 +840,17 @@ HttpChannelChild::CompleteRedirectSetup(
    * channel reflect AsyncOpen'ed state.
    */
 
   mIsPending = true;
   mWasOpened = true;
   mListener = listener;
   mListenerContext = aContext;
 
-  // add ourselves to the load group. 
+  // add ourselves to the load group.
   if (mLoadGroup)
     mLoadGroup->AddRequest(this, nullptr);
 
   // We already have an open IPDL connection to the parent. If on-modify-request
   // listeners or load group observers canceled us, let the parent handle it
   // and send it back to us naturally.
   return NS_OK;
 }
@@ -1014,17 +1014,17 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
   // notify "http-on-modify-request" observers
   //CallOnModifyRequestObservers();
 
   mIsPending = true;
   mWasOpened = true;
   mListener = listener;
   mListenerContext = aContext;
 
-  // add ourselves to the load group. 
+  // add ourselves to the load group.
   if (mLoadGroup)
     mLoadGroup->AddRequest(this, nullptr);
 
   if (mCanceled) {
     // We may have been canceled already, either by on-modify-request
     // listeners or by load group observers; in that case, don't create IPDL
     // connection. See nsHttpChannel::AsyncOpen().
     AsyncAbort(mStatus);
@@ -1092,18 +1092,18 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIHttpChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-HttpChannelChild::SetRequestHeader(const nsACString& aHeader, 
-                                   const nsACString& aValue, 
+HttpChannelChild::SetRequestHeader(const nsACString& aHeader,
+                                   const nsACString& aValue,
                                    bool aMerge)
 {
   nsresult rv = HttpBaseChannel::SetRequestHeader(aHeader, aValue, aMerge);
   if (NS_FAILED(rv))
     return rv;
 
   RequestHeaderTuple* tuple = mClientSetRequestHeaders.AppendElement();
   if (!tuple)
@@ -1347,27 +1347,27 @@ HttpChannelChild::GetAssociatedContentSe
     return false;
 
   if (_result)
     assoc.forget(_result);
   return true;
 }
 
 /* attribute unsigned long countSubRequestsBrokenSecurity; */
-NS_IMETHODIMP 
+NS_IMETHODIMP
 HttpChannelChild::GetCountSubRequestsBrokenSecurity(
                     int32_t *aSubRequestsBrokenSecurity)
 {
   nsCOMPtr<nsIAssociatedContentSecurity> assoc;
   if (!GetAssociatedContentSecurity(getter_AddRefs(assoc)))
     return NS_OK;
 
   return assoc->GetCountSubRequestsBrokenSecurity(aSubRequestsBrokenSecurity);
 }
-NS_IMETHODIMP 
+NS_IMETHODIMP
 HttpChannelChild::SetCountSubRequestsBrokenSecurity(
                     int32_t aSubRequestsBrokenSecurity)
 {
   nsCOMPtr<nsIAssociatedContentSecurity> assoc;
   if (!GetAssociatedContentSecurity(getter_AddRefs(assoc)))
     return NS_OK;
 
   return assoc->SetCountSubRequestsBrokenSecurity(aSubRequestsBrokenSecurity);
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -62,18 +62,18 @@ public:
   // nsIRequest
   NS_IMETHOD Cancel(nsresult status);
   NS_IMETHOD Suspend();
   NS_IMETHOD Resume();
   // nsIChannel
   NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo);
   NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *aContext);
   // HttpBaseChannel::nsIHttpChannel
-  NS_IMETHOD SetRequestHeader(const nsACString& aHeader, 
-                              const nsACString& aValue, 
+  NS_IMETHOD SetRequestHeader(const nsACString& aHeader,
+                              const nsACString& aValue,
                               bool aMerge);
   NS_IMETHOD RedirectTo(nsIURI *newURI);
   // nsIHttpChannelInternal
   NS_IMETHOD SetupFallbackChannel(const char *aFallbackKey);
   NS_IMETHOD GetLocalAddress(nsACString& addr);
   NS_IMETHOD GetLocalPort(int32_t* port);
   NS_IMETHOD GetRemoteAddress(nsACString& addr);
   NS_IMETHOD GetRemotePort(int32_t* port);
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -102,17 +102,17 @@ HttpChannelParent::GetInterface(const ns
 
   return QueryInterface(aIID, result);
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::PHttpChannelParent
 //-----------------------------------------------------------------------------
 
-bool 
+bool
 HttpChannelParent::RecvAsyncOpen(const URIParams&           aURI,
                                  const OptionalURIParams&   aOriginalURI,
                                  const OptionalURIParams&   aDocURI,
                                  const OptionalURIParams&   aReferrerURI,
                                  const OptionalURIParams&   aAPIRedirectToURI,
                                  const uint32_t&            loadFlags,
                                  const RequestHeaderTuples& requestHeaders,
                                  const nsHttpAtom&          requestMethod,
@@ -137,17 +137,17 @@ HttpChannelParent::RecvAsyncOpen(const U
   }
   nsCOMPtr<nsIURI> originalUri = DeserializeURI(aOriginalURI);
   nsCOMPtr<nsIURI> docUri = DeserializeURI(aDocURI);
   nsCOMPtr<nsIURI> referrerUri = DeserializeURI(aReferrerURI);
   nsCOMPtr<nsIURI> apiRedirectToUri = DeserializeURI(aAPIRedirectToURI);
 
   nsCString uriSpec;
   uri->GetSpec(uriSpec);
-  LOG(("HttpChannelParent RecvAsyncOpen [this=%x uri=%s]\n", 
+  LOG(("HttpChannelParent RecvAsyncOpen [this=%x uri=%s]\n",
        this, uriSpec.get()));
 
   nsresult rv;
 
   nsCOMPtr<nsIIOService> ios(do_GetIOService(&rv));
   if (NS_FAILED(rv))
     return SendFailedAsyncOpen(rv);
 
@@ -251,17 +251,17 @@ HttpChannelParent::RecvConnectChannel(co
     if (pbChannel) {
       pbChannel->SetPrivate(mPBOverride == kPBOverride_Private ? true : false);
     }
   }
 
   return true;
 }
 
-bool 
+bool
 HttpChannelParent::RecvSetPriority(const uint16_t& priority)
 {
   if (mChannel) {
     nsHttpChannel *httpChan = static_cast<nsHttpChannel *>(mChannel.get());
     httpChan->SetPriority(priority);
   }
 
   nsCOMPtr<nsISupportsPriority> priorityRedirectChannel =
@@ -317,17 +317,17 @@ HttpChannelParent::RecvUpdateAssociatedC
   if (mAssociatedContentSecurity) {
     mAssociatedContentSecurity->SetCountSubRequestsBrokenSecurity(broken);
     mAssociatedContentSecurity->SetCountSubRequestsNoSecurity(no);
   }
   return true;
 }
 
 bool
-HttpChannelParent::RecvRedirect2Verify(const nsresult& result, 
+HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
                                        const RequestHeaderTuples& changedHeaders,
                                        const OptionalURIParams&   aAPIRedirectURI)
 {
   if (NS_SUCCEEDED(result)) {
     nsCOMPtr<nsIHttpChannel> newHttpChannel =
         do_QueryInterface(mRedirectChannel);
 
     if (newHttpChannel) {
@@ -375,17 +375,17 @@ bool
 HttpChannelParent::RecvDocumentChannelCleanup()
 {
   // From now on only using mAssociatedContentSecurity.  Free everything else.
   mChannel = 0;          // Reclaim some memory sooner.
   mCacheDescriptor = 0;  // Else we'll block other channels reading same URI
   return true;
 }
 
-bool 
+bool
 HttpChannelParent::RecvMarkOfflineCacheEntryAsForeign()
 {
   if (mOfflineForeignMarker) {
     mOfflineForeignMarker->MarkAsForeign();
     mOfflineForeignMarker = 0;
   }
 
   return true;
@@ -415,17 +415,17 @@ HttpChannelParent::OnStartRequest(nsIReq
   if (loadedFromApplicationCache) {
     mOfflineForeignMarker = chan->GetOfflineCacheEntryAsForeignMarker();
     nsCOMPtr<nsIApplicationCache> appCache;
     chan->GetApplicationCache(getter_AddRefs(appCache));
     nsCString appCacheGroupId;
     nsCString appCacheClientId;
     appCache->GetGroupID(appCacheGroupId);
     appCache->GetClientID(appCacheClientId);
-    if (mIPCClosed || 
+    if (mIPCClosed ||
         !SendAssociateApplicationCache(appCacheGroupId, appCacheClientId))
     {
       return NS_ERROR_UNEXPECTED;
     }
   }
 
   nsCOMPtr<nsIEncodedChannel> encodedChannel = do_QueryInterface(aRequest);
   if (encodedChannel)
@@ -441,52 +441,52 @@ HttpChannelParent::OnStartRequest(nsIReq
   if (secInfoSupp) {
     mAssociatedContentSecurity = do_QueryInterface(secInfoSupp);
     nsCOMPtr<nsISerializable> secInfoSer = do_QueryInterface(secInfoSupp);
     if (secInfoSer)
       NS_SerializeToString(secInfoSer, secInfoSerialization);
   }
 
   nsHttpChannel *httpChan = static_cast<nsHttpChannel *>(mChannel.get());
-  if (mIPCClosed || 
-      !SendOnStartRequest(responseHead ? *responseHead : nsHttpResponseHead(), 
+  if (mIPCClosed ||
+      !SendOnStartRequest(responseHead ? *responseHead : nsHttpResponseHead(),
                           !!responseHead,
                           requestHead->Headers(),
                           isFromCache,
                           mCacheDescriptor ? true : false,
                           expirationTime, cachedCharset, secInfoSerialization,
-                          httpChan->GetSelfAddr(), httpChan->GetPeerAddr())) 
+                          httpChan->GetSelfAddr(), httpChan->GetPeerAddr()))
   {
-    return NS_ERROR_UNEXPECTED; 
+    return NS_ERROR_UNEXPECTED;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpChannelParent::OnStopRequest(nsIRequest *aRequest, 
-                                 nsISupports *aContext, 
+HttpChannelParent::OnStopRequest(nsIRequest *aRequest,
+                                 nsISupports *aContext,
                                  nsresult aStatusCode)
 {
-  LOG(("HttpChannelParent::OnStopRequest: [this=%x status=%ul]\n", 
+  LOG(("HttpChannelParent::OnStopRequest: [this=%x status=%ul]\n",
        this, aStatusCode));
 
   if (mIPCClosed || !SendOnStopRequest(aStatusCode))
-    return NS_ERROR_UNEXPECTED; 
+    return NS_ERROR_UNEXPECTED;
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-HttpChannelParent::OnDataAvailable(nsIRequest *aRequest, 
-                                   nsISupports *aContext, 
-                                   nsIInputStream *aInputStream, 
-                                   uint64_t aOffset, 
+HttpChannelParent::OnDataAvailable(nsIRequest *aRequest,
+                                   nsISupports *aContext,
+                                   nsIInputStream *aInputStream,
+                                   uint64_t aOffset,
                                    uint32_t aCount)
 {
   LOG(("HttpChannelParent::OnDataAvailable [this=%x]\n", this));
 
   nsCString data;
   nsresult rv = NS_ReadInputStreamToString(aInputStream, data, aCount);
   if (NS_FAILED(rv))
     return rv;
@@ -503,19 +503,19 @@ HttpChannelParent::OnDataAvailable(nsIRe
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::nsIProgressEventSink
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-HttpChannelParent::OnProgress(nsIRequest *aRequest, 
-                              nsISupports *aContext, 
-                              uint64_t aProgress, 
+HttpChannelParent::OnProgress(nsIRequest *aRequest,
+                              nsISupports *aContext,
+                              uint64_t aProgress,
                               uint64_t aProgressMax)
 {
   // OnStatus has always just set mStoredStatus. If it indicates this precedes
   // OnDataAvailable, store and ODA will send to child.
   if (mStoredStatus == NS_NET_STATUS_RECEIVING_FROM ||
       mStoredStatus == NS_NET_STATUS_READING)
   {
     mStoredProgress = aProgress;
@@ -527,19 +527,19 @@ HttpChannelParent::OnProgress(nsIRequest
     if (mIPCClosed || !SendOnProgress(aProgress, aProgressMax))
       return NS_ERROR_UNEXPECTED;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpChannelParent::OnStatus(nsIRequest *aRequest, 
-                            nsISupports *aContext, 
-                            nsresult aStatus, 
+HttpChannelParent::OnStatus(nsIRequest *aRequest,
+                            nsISupports *aContext,
+                            nsresult aStatus,
                             const PRUnichar *aStatusArg)
 {
   // If this precedes OnDataAvailable, store and ODA will send to child.
   if (aStatus == NS_NET_STATUS_RECEIVING_FROM ||
       aStatus == NS_NET_STATUS_READING)
   {
     mStoredStatus = aStatus;
     return NS_OK;
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -37,17 +37,17 @@ HttpChannelParentListener::HttpChannelPa
 HttpChannelParentListener::~HttpChannelParentListener()
 {
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParentListener::nsISupports
 //-----------------------------------------------------------------------------
 
-NS_IMPL_ISUPPORTS5(HttpChannelParentListener, 
+NS_IMPL_ISUPPORTS5(HttpChannelParentListener,
                    nsIInterfaceRequestor,
                    nsIStreamListener,
                    nsIRequestObserver,
                    nsIChannelEventSink,
                    nsIRedirectResultListener)
 
 //-----------------------------------------------------------------------------
 // HttpChannelParentListener::nsIRequestObserver
@@ -59,54 +59,54 @@ HttpChannelParentListener::OnStartReques
   if (!mActiveChannel)
     return NS_ERROR_UNEXPECTED;
 
   LOG(("HttpChannelParentListener::OnStartRequest [this=%x]\n", this));
   return mActiveChannel->OnStartRequest(aRequest, aContext);
 }
 
 NS_IMETHODIMP
-HttpChannelParentListener::OnStopRequest(nsIRequest *aRequest, 
-                                          nsISupports *aContext, 
+HttpChannelParentListener::OnStopRequest(nsIRequest *aRequest,
+                                          nsISupports *aContext,
                                           nsresult aStatusCode)
 {
   if (!mActiveChannel)
     return NS_ERROR_UNEXPECTED;
 
-  LOG(("HttpChannelParentListener::OnStopRequest: [this=%x status=%ul]\n", 
+  LOG(("HttpChannelParentListener::OnStopRequest: [this=%x status=%ul]\n",
        this, aStatusCode));
   nsresult rv = mActiveChannel->OnStopRequest(aRequest, aContext, aStatusCode);
 
   mActiveChannel = nullptr;
   return rv;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParentListener::nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-HttpChannelParentListener::OnDataAvailable(nsIRequest *aRequest, 
-                                            nsISupports *aContext, 
-                                            nsIInputStream *aInputStream, 
-                                            uint64_t aOffset, 
+HttpChannelParentListener::OnDataAvailable(nsIRequest *aRequest,
+                                            nsISupports *aContext,
+                                            nsIInputStream *aInputStream,
+                                            uint64_t aOffset,
                                             uint32_t aCount)
 {
   if (!mActiveChannel)
     return NS_ERROR_UNEXPECTED;
 
   LOG(("HttpChannelParentListener::OnDataAvailable [this=%x]\n", this));
   return mActiveChannel->OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount);
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParentListener::nsIInterfaceRequestor
 //-----------------------------------------------------------------------------
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 HttpChannelParentListener::GetInterface(const nsIID& aIID, void **result)
 {
   if (aIID.Equals(NS_GET_IID(nsIChannelEventSink)) ||
       aIID.Equals(NS_GET_IID(nsIHttpEventSink))  ||
       aIID.Equals(NS_GET_IID(nsIRedirectResultListener)))
   {
     return QueryInterface(aIID, result);
   }
--- a/netwerk/protocol/http/NullHttpTransaction.cpp
+++ b/netwerk/protocol/http/NullHttpTransaction.cpp
@@ -122,17 +122,17 @@ NullHttpTransaction::RequestHead()
     if (NS_SUCCEEDED(rv))
        mRequestHead->SetHeader(nsHttp::Host, hostHeader);
 
     // CONNECT tunnels may also want Proxy-Authorization but that is a lot
     // harder to determine, so for now we will let those connections fail in
     // the NullHttpTransaction and let them be retried from the pending queue
     // with a bound transcation
   }
-  
+
   return mRequestHead;
 }
 
 nsresult
 NullHttpTransaction::TakeSubTransactions(
   nsTArray<nsRefPtr<nsAHttpTransaction> > &outTransactions)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
@@ -163,17 +163,17 @@ NullHttpTransaction::PipelineDepth()
   return 0;
 }
 
 nsresult
 NullHttpTransaction::SetPipelinePosition(int32_t position)
 {
     return NS_OK;
 }
- 
+
 int32_t
 NullHttpTransaction::PipelinePosition()
 {
   return 1;
 }
 
 } // namespace mozilla::net
 } // namespace mozilla
--- a/netwerk/protocol/http/PHttpChannel.ipdl
+++ b/netwerk/protocol/http/PHttpChannel.ipdl
@@ -71,30 +71,30 @@ parent:
   Cancel(nsresult status);
 
   // Reports approval/veto of redirect by child process redirect observers
   Redirect2Verify(nsresult result, RequestHeaderTuples changedHeaders,
                   OptionalURIParams apiRedirectTo);
 
   // For document loads we keep this protocol open after child's
   // OnStopRequest, and send this msg (instead of __delete__) to allow
-  // partial cleanup on parent. 
+  // partial cleanup on parent.
   DocumentChannelCleanup();
 
   // This might have to be sync. If this fails we must fail the document load
   // to avoid endless loop.
   //
   // Explanation: the document loaded was loaded from the offline cache. But
-  // the cache group id (the manifest URL) of the cache group it was loaded 
-  // from is different then the manifest the document refers to in the html 
-  // tag. If we detect this during the cache selection algorithm, we must not 
+  // the cache group id (the manifest URL) of the cache group it was loaded
+  // from is different then the manifest the document refers to in the html
+  // tag. If we detect this during the cache selection algorithm, we must not
   // load this document from the offline cache group it was just loaded from.
   // Marking the cache entry as foreign in its cache group will prevent
   // the document to load from the bad offline cache group. After it is marked,
-  // we reload the document to take the effect. If we fail to mark the entry 
+  // we reload the document to take the effect. If we fail to mark the entry
   // as foreign, we will end up in the same situation and reload again and
   // again, indefinitely.
   MarkOfflineCacheEntryAsForeign();
 
   __delete__();
 
 child:
   OnStartRequest(nsHttpResponseHead  responseHead,
--- a/netwerk/protocol/http/README
+++ b/netwerk/protocol/http/README
@@ -14,17 +14,17 @@ CLASS BREAKDOWN
     - holds references to frequently used services
 
   nsHttpChannel
     - implements nsIHttpChannel
     - talks to the cache
     - initiates http transactions
     - processes http response codes
     - intercepts progress notifications
-  
+
   nsHttpConnection
     - implements nsIStreamListener & nsIStreamProvider
     - talks to the socket transport service
     - feeds data to its transaction object
     - routes progress notifications
 
   nsHttpConnectionInfo
     - identifies a connection
@@ -32,17 +32,17 @@ CLASS BREAKDOWN
   nsHttpTransaction
     - implements nsIRequest
     - encapsulates a http request and response
     - parses incoming data
 
   nsHttpChunkedDecoder
     - owned by a transaction
     - removes chunked decoding
-  
+
   nsHttpRequestHead
     - owns a nsHttpHeaderArray
     - knows how to fill a request buffer
 
   nsHttpResponseHead
     - owns a nsHttpHeaderArray
     - knows how to parse response lines
     - performs common header manipulations/calculations
@@ -65,17 +65,17 @@ ATOMS
   eg. nsHttp::Content_Length
 
 
 TRANSACTION MODEL
 
   InitiateTransaction -> ActivateConnection -> AsyncWrite, AsyncRead
 
   The channel creates transactions, and passes them to the handler via
-  InitiateTransaction along with a nsHttpConnectionInfo object 
+  InitiateTransaction along with a nsHttpConnectionInfo object
   identifying the requested connection.  The handler either dispatches
   the transaction immediately or queues it up to be dispatched later,
   depending on whether or not the limit on the number of connections
   to the requested server has been reached.  Once the transaction can
   be run, the handler looks for an idle connection or creates a new
   connection, and then (re)activates the connection, assigning it the
   new transaction.
 
--- a/netwerk/protocol/http/SpdySession2.cpp
+++ b/netwerk/protocol/http/SpdySession2.cpp
@@ -62,40 +62,40 @@ SpdySession2::SpdySession2(nsAHttpTransa
     mLastReadEpoch(PR_IntervalNow()),
     mPingSentEpoch(0),
     mNextPingID(1)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
   LOG3(("SpdySession2::SpdySession2 %p transaction 1 = %p",
         this, aHttpTransaction));
-  
+
   mStreamIDHash.Init();
   mStreamTransactionHash.Init();
   mConnection = aHttpTransaction->Connection();
   mInputFrameBuffer = new char[mInputFrameBufferSize];
   mDecompressBuffer = new char[mDecompressBufferSize];
   mOutputQueueBuffer = new char[mOutputQueueSize];
   zlibInit();
-  
+
   mSendingChunkSize = gHttpHandler->SpdySendingChunkSize();
   if (!aHttpTransaction->IsNullTransaction())
     AddStream(aHttpTransaction, firstPriority);
   mLastDataReadEpoch = mLastReadEpoch;
-  
+
   mPingThreshold = gHttpHandler->SpdyPingThreshold();
 }
 
 PLDHashOperator
 SpdySession2::ShutdownEnumerator(nsAHttpTransaction *key,
                                 nsAutoPtr<SpdyStream2> &stream,
                                 void *closure)
 {
   SpdySession2 *self = static_cast<SpdySession2 *>(closure);
- 
+
   // On a clean server hangup the server sets the GoAwayID to be the ID of
   // the last transaction it processed. If the ID of stream in the
   // local stream is greater than that it can safely be restarted because the
   // server guarantees it was not partially processed. Streams that have not
   // registered an ID haven't actually been sent yet so they can always be
   // restarted.
   if (self->mCleanShutdown &&
       (stream->StreamID() > self->mGoAwayID || !stream->HasRegisteredID()))
@@ -124,31 +124,31 @@ SpdySession2::GoAwayEnumerator(nsAHttpTr
 
 SpdySession2::~SpdySession2()
 {
   LOG3(("SpdySession2::~SpdySession2 %p mDownstreamState=%X",
         this, mDownstreamState));
 
   inflateEnd(&mDownstreamZlib);
   deflateEnd(&mUpstreamZlib);
-  
+
   mStreamTransactionHash.Enumerate(ShutdownEnumerator, this);
   Telemetry::Accumulate(Telemetry::SPDY_PARALLEL_STREAMS, mConcurrentHighWater);
   Telemetry::Accumulate(Telemetry::SPDY_REQUEST_PER_CONN, (mNextStreamID - 1) / 2);
   Telemetry::Accumulate(Telemetry::SPDY_SERVER_INITIATED_STREAMS,
                         mServerPushedResources);
 }
 
 void
 SpdySession2::LogIO(SpdySession2 *self, SpdyStream2 *stream, const char *label,
                    const char *data, uint32_t datalen)
 {
   if (!LOG4_ENABLED())
     return;
-  
+
   LOG4(("SpdySession2::LogIO %p stream=%p id=0x%X [%s]",
         self, stream, stream ? stream->StreamID() : 0, label));
 
   // Max line is (16 * 3) + 10(prefix) + newline + null
   char linebuf[128];
   uint32_t index;
   char *line = linebuf;
 
@@ -170,17 +170,17 @@ SpdySession2::LogIO(SpdySession2 *self, 
   }
   if (index) {
     *line = 0;
     LOG4(("%s", linebuf));
   }
 }
 
 typedef nsresult  (*Control_FX) (SpdySession2 *self);
-static Control_FX sControlFunctions[] = 
+static Control_FX sControlFunctions[] =
 {
   nullptr,
   SpdySession2::HandleSynStream,
   SpdySession2::HandleSynReply,
   SpdySession2::HandleRstStream,
   SpdySession2::HandleSettings,
   SpdySession2::HandleNoop,
   SpdySession2::HandlePing,
@@ -236,17 +236,17 @@ SpdySession2::ReadTimeoutTick(PRInterval
       if ((now - mPingSentEpoch) >= gHttpHandler->SpdyPingTimeout()) {
         LOG(("SpdySession2::ReadTimeoutTick %p Ping Timer Exhaustion\n",
              this));
         mPingSentEpoch = 0;
         Close(NS_ERROR_NET_TIMEOUT);
       }
       return;
     }
-    
+
     LOG(("SpdySession2::ReadTimeoutTick %p generating ping 0x%x\n",
          this, mNextPingID));
 
     if (mNextPingID == 0xffffffff) {
       LOG(("SpdySession2::ReadTimeoutTick %p cannot form ping - ids exhausted\n",
            this));
       return;
     }
@@ -269,17 +269,17 @@ uint32_t
 SpdySession2::RegisterStreamID(SpdyStream2 *stream)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
   LOG3(("SpdySession2::RegisterStreamID session=%p stream=%p id=0x%X "
         "concurrent=%d",this, stream, mNextStreamID, mConcurrent));
 
   MOZ_ASSERT(mNextStreamID < 0xfffffff0, "should have stopped admitting streams");
-  
+
   uint32_t result = mNextStreamID;
   mNextStreamID += 2;
 
   // We've used up plenty of ID's on this session. Start
   // moving to a new one before there is a crunch involving
   // server push streams or concurrent non-registered submits
   if (mNextStreamID >= kMaxStreamID)
     mShouldGoAway = true;
@@ -312,33 +312,33 @@ SpdySession2::AddStream(nsAHttpTransacti
   aHttpTransaction->SetConnection(this);
   SpdyStream2 *stream = new SpdyStream2(aHttpTransaction,
                                       this,
                                       mSocketTransport,
                                       mSendingChunkSize,
                                       &mUpstreamZlib,
                                       aPriority);
 
-  
+
   LOG3(("SpdySession2::AddStream session=%p stream=%p NextID=0x%X (tentative)",
         this, stream, mNextStreamID));
 
   mStreamTransactionHash.Put(aHttpTransaction, stream);
 
   if (RoomForMoreConcurrent()) {
     LOG3(("SpdySession2::AddStream %p stream %p activated immediately.",
           this, stream));
     ActivateStream(stream);
   }
   else {
     LOG3(("SpdySession2::AddStream %p stream %p queued.",
           this, stream));
     mQueuedStreams.Push(stream);
   }
-  
+
   return true;
 }
 
 void
 SpdySession2::ActivateStream(SpdyStream2 *stream)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
@@ -410,42 +410,42 @@ SpdySession2::RealignOutputQueue()
   mOutputQueueSent = 0;
 }
 
 void
 SpdySession2::FlushOutputQueue()
 {
   if (!mSegmentReader || !mOutputQueueUsed)
     return;
-  
+
   nsresult rv;
   uint32_t countRead;
   uint32_t avail = mOutputQueueUsed - mOutputQueueSent;
 
   rv = mSegmentReader->
     OnReadSegment(mOutputQueueBuffer.get() + mOutputQueueSent, avail,
                                      &countRead);
   LOG3(("SpdySession2::FlushOutputQueue %p sz=%d rv=%x actual=%d",
         this, avail, rv, countRead));
-  
+
   // Dont worry about errors on write, we will pick this up as a read error too
   if (NS_FAILED(rv))
     return;
-  
+
   if (countRead == avail) {
     mOutputQueueUsed = 0;
     mOutputQueueSent = 0;
     return;
   }
 
   mOutputQueueSent += countRead;
 
   // If the output queue is close to filling up and we have sent out a good
   // chunk of data from the beginning then realign it.
-  
+
   if ((mOutputQueueSent >= kQueueMinimumCleanup) &&
       ((mOutputQueueSize - mOutputQueueUsed) < kQueueTailRoom)) {
     RealignOutputQueue();
   }
 }
 
 void
 SpdySession2::DontReuse()
@@ -496,23 +496,23 @@ SpdySession2::ResetDownstreamState()
 void
 SpdySession2::EnsureBuffer(nsAutoArrayPtr<char> &buf,
                           uint32_t newSize,
                           uint32_t preserve,
                           uint32_t &objSize)
 {
   if (objSize >= newSize)
       return;
-  
+
   // Leave a little slop on the new allocation - add 2KB to
   // what we need and then round the result up to a 4KB (page)
   // boundary.
 
   objSize = (newSize + 2048 + 4095) & ~4095;
-  
+
   nsAutoArrayPtr<char> tmp(new char[objSize]);
   memcpy(tmp, buf, preserve);
   buf = tmp;
 }
 
 void
 SpdySession2::zlibInit()
 {
@@ -552,30 +552,30 @@ SpdySession2::DownstreamUncompress(char 
     mDownstreamZlib.avail_out = mDecompressBufferSize - mDecompressBufferUsed;
     int zlib_rv = inflate(&mDownstreamZlib, Z_NO_FLUSH);
 
     if (zlib_rv == Z_NEED_DICT) {
       if (triedDictionary) {
         LOG3(("SpdySession2::DownstreamUncompress %p Dictionary Error\n", this));
         return NS_ERROR_FAILURE;
       }
-      
+
       triedDictionary = true;
       inflateSetDictionary(&mDownstreamZlib,
                            reinterpret_cast<const unsigned char *>
                            (SpdyStream2::kDictionary),
                            strlen(SpdyStream2::kDictionary) + 1);
     }
-    
+
     if (zlib_rv == Z_DATA_ERROR || zlib_rv == Z_MEM_ERROR)
       return NS_ERROR_FAILURE;
 
     mDecompressBufferUsed += mDecompressBufferSize - mDecompressBufferUsed -
       mDownstreamZlib.avail_out;
-    
+
     // When there is no more output room, but input still available then
     // increase the output space
     if (zlib_rv == Z_OK &&
         !mDownstreamZlib.avail_out && mDownstreamZlib.avail_in) {
       LOG3(("SpdySession2::DownstreamUncompress %p Large Headers - so far %d",
             this, mDecompressBufferSize));
       EnsureBuffer(mDecompressBuffer,
                    mDecompressBufferSize + 4096,
@@ -630,17 +630,17 @@ SpdySession2::ConvertHeaders(nsDependent
   mFlatHTTPResponseHeadersOut = 0;
   mFlatHTTPResponseHeaders.SetCapacity(mDecompressBufferUsed + 64);
 
   // Connection, Keep-Alive and chunked transfer encodings are to be
   // removed.
 
   // Content-Length is 'advisory'.. we will not strip it because it can
   // create UI feedback.
-  
+
   mFlatHTTPResponseHeaders.Append(version);
   mFlatHTTPResponseHeaders.Append(NS_LITERAL_CSTRING(" "));
   mFlatHTTPResponseHeaders.Append(status);
   mFlatHTTPResponseHeaders.Append(NS_LITERAL_CSTRING("\r\n"));
 
   const unsigned char *nvpair = reinterpret_cast<unsigned char *>
     (mDecompressBuffer.get()) + 2;
   const unsigned char *lastHeaderByte = reinterpret_cast<unsigned char *>
@@ -708,17 +708,17 @@ SpdySession2::ConvertHeaders(nsDependent
     if (!nameString.Equals(NS_LITERAL_CSTRING("version")) &&
         !nameString.Equals(NS_LITERAL_CSTRING("status")) &&
         !nameString.Equals(NS_LITERAL_CSTRING("connection")) &&
         !nameString.Equals(NS_LITERAL_CSTRING("keep-alive"))) {
       nsDependentCSubstring valueString =
         Substring(reinterpret_cast<const char *>(nvpair) + 4 + nameLen,
                   reinterpret_cast<const char *>(nvpair) + 4 + nameLen +
                   valueLen);
-      
+
       mFlatHTTPResponseHeaders.Append(nameString);
       mFlatHTTPResponseHeaders.Append(NS_LITERAL_CSTRING(": "));
 
       // expand NULL bytes in the value string
       for (char *cPtr = valueString.BeginWriting();
            cPtr && cPtr < valueString.EndWriting();
            ++cPtr) {
         if (*cPtr != 0) {
@@ -736,17 +736,17 @@ SpdySession2::ConvertHeaders(nsDependent
     }
     nvpair += 4 + nameLen + valueLen;
   }
 
   mFlatHTTPResponseHeaders.Append(
     NS_LITERAL_CSTRING("X-Firefox-Spdy: 2\r\n\r\n"));
   LOG (("decoded response headers are:\n%s",
         mFlatHTTPResponseHeaders.get()));
-  
+
   return NS_OK;
 }
 
 void
 SpdySession2::GeneratePing(uint32_t aID)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   LOG3(("SpdySession2::GeneratePing %p 0x%X\n", this, aID));
@@ -759,17 +759,17 @@ SpdySession2::GeneratePing(uint32_t aID)
   packet[0] = kFlag_Control;
   packet[1] = 2;                                  /* version 2 */
   packet[2] = 0;
   packet[3] = CONTROL_TYPE_PING;
   packet[4] = 0;                                  /* flags */
   packet[5] = 0;
   packet[6] = 0;
   packet[7] = 4;                                  /* length */
-  
+
   aID = PR_htonl(aID);
   memcpy(packet + 8, &aID, 4);
 
   FlushOutputQueue();
 }
 
 void
 SpdySession2::GenerateRstStream(uint32_t aStatusCode, uint32_t aID)
@@ -785,17 +785,17 @@ SpdySession2::GenerateRstStream(uint32_t
   packet[0] = kFlag_Control;
   packet[1] = 2;                                  /* version 2 */
   packet[2] = 0;
   packet[3] = CONTROL_TYPE_RST_STREAM;
   packet[4] = 0;                                  /* flags */
   packet[5] = 0;
   packet[6] = 0;
   packet[7] = 8;                                  /* length */
-  
+
   aID = PR_htonl(aID);
   memcpy(packet + 8, &aID, 4);
   aStatusCode = PR_htonl(aStatusCode);
   memcpy(packet + 12, &aStatusCode, 4);
 
   FlushOutputQueue();
 }
 
@@ -810,17 +810,17 @@ SpdySession2::GenerateGoAway()
   char *packet = mOutputQueueBuffer.get() + mOutputQueueUsed;
   mOutputQueueUsed += 12;
 
   memset(packet, 0, 12);
   packet[0] = kFlag_Control;
   packet[1] = 2;                                  /* version 2 */
   packet[3] = CONTROL_TYPE_GOAWAY;
   packet[7] = 4;                                  /* data length */
-  
+
   // last-good-stream-id are bytes 8-11, when we accept server push this will
   // need to be set non zero
 
   FlushOutputQueue();
 }
 
 // perform a bunch of integrity checks on the stream.
 // returns true if passed, false (plus LOG and ABORT) if failed.
@@ -834,31 +834,31 @@ SpdySession2::VerifyStream(SpdyStream2 *
   // Only do the real verification in debug builds
   return true;
 #endif
 
   if (!aStream)
     return true;
 
   uint32_t test = 0;
-  
+
   do {
     if (aStream->StreamID() == kDeadStreamID)
       break;
 
     nsAHttpTransaction *trans = aStream->Transaction();
 
-    test++;  
+    test++;
     if (!trans)
       break;
 
     test++;
     if (mStreamTransactionHash.Get(trans) != aStream)
       break;
-    
+
     if (aStream->StreamID()) {
       SpdyStream2 *idStream = mStreamIDHash.Get(aStream->StreamID());
 
       test++;
       if (idStream != aStream)
         break;
 
       if (aOptionalID) {
@@ -895,17 +895,17 @@ SpdySession2::CleanupStream(SpdyStream2 
 
   if (!aStream->RecvdFin() && aStream->StreamID()) {
     LOG3(("Stream had not processed recv FIN, sending RST code %X\n",
           aResetCode));
     GenerateRstStream(aResetCode, aStream->StreamID());
     --mConcurrent;
     ProcessPending();
   }
-  
+
   CloseStream(aStream, aResult);
 
   // Remove the stream from the ID hash table. (this one isn't short, which is
   // why it is hashed.)
   mStreamIDHash.Remove(aStream->StreamID());
 
   // removing from the stream transaction hash will
   // delete the SpdyStream2 and drop the reference to
@@ -960,32 +960,32 @@ SpdySession2::CloseStream(SpdyStream2 *a
   // Send the stream the close() indication
   aStream->Close(aResult);
 }
 
 nsresult
 SpdySession2::HandleSynStream(SpdySession2 *self)
 {
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_SYN_STREAM);
-  
+
   if (self->mInputFrameDataSize < 18) {
     LOG3(("SpdySession2::HandleSynStream %p SYN_STREAM too short data=%d",
           self, self->mInputFrameDataSize));
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   uint32_t streamID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[2]);
   uint32_t associatedID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[3]);
 
   LOG3(("SpdySession2::HandleSynStream %p recv SYN_STREAM (push) "
         "for ID 0x%X associated with 0x%X.",
         self, streamID, associatedID));
-    
+
   if (streamID & 0x01) {                   // test for odd stream ID
     LOG3(("SpdySession2::HandleSynStream %p recvd SYN_STREAM id must be even.",
           self));
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   ++(self->mServerPushedResources);
 
@@ -1028,17 +1028,17 @@ SpdySession2::HandleSynReply(SpdySession
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_SYN_REPLY);
 
   if (self->mInputFrameDataSize < 8) {
     LOG3(("SpdySession2::HandleSynReply %p SYN REPLY too short data=%d",
           self, self->mInputFrameDataSize));
     // A framing error is a session wide error that cannot be recovered
     return NS_ERROR_ILLEGAL_VALUE;
   }
-  
+
   // Uncompress the headers into mDecompressBuffer, leaving them in
   // spdy format for the time being. Make certain to do this
   // step before any error handling that might abort the stream but not
   // the session becuase the session compression context will become
   // inconsistent if all of the compressed data is not processed.
   if (NS_FAILED(self->DownstreamUncompress(self->mInputFrameBuffer + 14,
                                            self->mInputFrameDataSize - 6))) {
     LOG(("SpdySession2::HandleSynReply uncompress failed\n"));
@@ -1099,17 +1099,17 @@ SpdySession2::HandleSynReplyForValidStre
   if (mInputFrameBuffer[4] & kFlag_Data_UNI) {
     LOG3(("SynReply had unidirectional flag set on it - nonsensical"));
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   LOG3(("SpdySession2::HandleSynReplyForValidStream %p SYN_REPLY for 0x%X "
         "fin=%d",
         this, mInputFrameDataStream->StreamID(), mInputFrameDataLast));
-  
+
   Telemetry::Accumulate(Telemetry::SPDY_SYN_REPLY_SIZE,
                         mInputFrameDataSize - 6);
   if (mDecompressBufferUsed) {
     uint32_t ratio =
       (mInputFrameDataSize - 6) * 100 / mDecompressBufferUsed;
     Telemetry::Accumulate(Telemetry::SPDY_SYN_REPLY_RATIO, ratio);
   }
 
@@ -1160,26 +1160,26 @@ SpdySession2::HandleRstStream(SpdySessio
   LOG3(("SpdySession2::HandleRstStream %p RST_STREAM Reason Code %u ID %x "
         "flags %x", self, self->mDownstreamRstReason, streamID, flags));
 
   if (flags != 0) {
     LOG3(("SpdySession2::HandleRstStream %p RST_STREAM with flags is illegal",
           self));
     return NS_ERROR_ILLEGAL_VALUE;
   }
-  
+
   if (self->mDownstreamRstReason == RST_INVALID_STREAM ||
       self->mDownstreamRstReason == RST_FLOW_CONTROL_ERROR) {
     // basically just ignore this
     self->ResetDownstreamState();
     return NS_OK;
   }
 
   nsresult rv = self->SetInputFrameDataStream(streamID);
-  
+
   if (!self->mInputFrameDataStream) {
     if (NS_FAILED(rv))
       LOG(("SpdySession2::HandleRstStream %p lookup streamID for RST Frame "
            "0x%X failed reason = %d :: VerifyStream Failed\n", self, streamID,
            self->mDownstreamRstReason));
 
     LOG3(("SpdySession2::HandleRstStream %p lookup streamID for RST Frame "
           "0x%X failed reason = %d", self, streamID,
@@ -1218,63 +1218,63 @@ SpdySession2::HandleSettings(SpdySession
   LOG3(("SpdySession2::HandleSettings %p SETTINGS Control Frame with %d entries",
         self, numEntries));
 
   for (uint32_t index = 0; index < numEntries; ++index) {
     // To clarify the v2 spec:
     // Each entry is a 24 bits of a little endian id
     // followed by 8 bits of flags
     // followed by a 32 bit big endian value
-    
+
     unsigned char *setting = reinterpret_cast<unsigned char *>
       (self->mInputFrameBuffer.get()) + 12 + index * 8;
 
     uint32_t id = (setting[2] << 16) + (setting[1] << 8) + setting[0];
     uint32_t flags = setting[3];
     uint32_t value =  PR_ntohl(reinterpret_cast<uint32_t *>(setting)[1]);
 
     LOG3(("Settings ID %d, Flags %X, Value %d", id, flags, value));
 
     switch (id)
     {
     case SETTINGS_TYPE_UPLOAD_BW:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_UL_BW, value);
       break;
-      
+
     case SETTINGS_TYPE_DOWNLOAD_BW:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_DL_BW, value);
       break;
-      
+
     case SETTINGS_TYPE_RTT:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_RTT, value);
       break;
-      
+
     case SETTINGS_TYPE_MAX_CONCURRENT:
       self->mMaxConcurrent = value;
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_MAX_STREAMS, value);
       break;
-      
+
     case SETTINGS_TYPE_CWND:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_CWND, value);
       break;
-      
+
     case SETTINGS_TYPE_DOWNLOAD_RETRANS_RATE:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_RETRANS, value);
       break;
-      
+
     case SETTINGS_TYPE_INITIAL_WINDOW:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_IW, value >> 10);
       break;
-      
+
     default:
       break;
     }
-    
+
   }
-  
+
   self->ResetDownstreamState();
   return NS_OK;
 }
 
 nsresult
 SpdySession2::HandleNoop(SpdySession2 *self)
 {
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_NOOP);
@@ -1310,17 +1310,17 @@ SpdySession2::HandlePing(SpdySession2 *s
   if (pingID & 0x01) {
     // presumably a reply to our timeout ping
     self->mPingSentEpoch = 0;
   }
   else {
     // Servers initiate even numbered pings, go ahead and echo it back
     self->GeneratePing(pingID);
   }
-    
+
   self->ResetDownstreamState();
   return NS_OK;
 }
 
 nsresult
 SpdySession2::HandleGoAway(SpdySession2 *self)
 {
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_GOAWAY);
@@ -1331,17 +1331,17 @@ SpdySession2::HandleGoAway(SpdySession2 
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   self->mShouldGoAway = true;
   self->mGoAwayID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[2]);
   self->mCleanShutdown = true;
 
-  // Find streams greater than the last-good ID and mark them for deletion 
+  // Find streams greater than the last-good ID and mark them for deletion
   // in the mGoAwayStreamsToRestart queue with the GoAwayEnumerator. They can
   // be restarted.
   self->mStreamTransactionHash.Enumerate(GoAwayEnumerator, self);
 
   // Process the streams marked for deletion and restart.
   uint32_t size = self->mGoAwayStreamsToRestart.GetSize();
   for (uint32_t count = 0; count < size; ++count) {
     SpdyStream2 *stream =
@@ -1474,17 +1474,17 @@ SpdySession2::OnTransportStatus(nsITrans
 // generated instead.
 
 nsresult
 SpdySession2::ReadSegments(nsAHttpSegmentReader *reader,
                           uint32_t count,
                           uint32_t *countRead)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   MOZ_ASSERT(!mSegmentReader || !reader || (mSegmentReader == reader),
              "Inconsistent Write Function Callback");
 
   if (reader)
     mSegmentReader = reader;
 
   nsresult rv;
   *countRead = 0;
@@ -1493,75 +1493,75 @@ SpdySession2::ReadSegments(nsAHttpSegmen
   // blocked part way through. Then to frames that have no streams (e.g ping
   // reply) and then third to streams marked urgent (generally they have
   // window updates), and finally to streams generally
   // ready to send data frames (http requests).
 
   LOG3(("SpdySession2::ReadSegments %p", this));
 
   SpdyStream2 *stream;
-  
+
   stream = static_cast<SpdyStream2 *>(mUrgentForWrite.PopFront());
   if (!stream)
     stream = static_cast<SpdyStream2 *>(mReadyForWrite.PopFront());
   if (!stream) {
     LOG3(("SpdySession2 %p could not identify a stream to write; suspending.",
           this));
     FlushOutputQueue();
     SetWriteCallbacks();
     return NS_BASE_STREAM_WOULD_BLOCK;
   }
-  
+
   LOG3(("SpdySession2 %p will write from SpdyStream2 %p", this, stream));
 
   rv = stream->ReadSegments(this, count, countRead);
 
   // Not every permutation of stream->ReadSegents produces data (and therefore
   // tries to flush the output queue) - SENDING_FIN_STREAM can be an example
   // of that. But we might still have old data buffered that would be good
   // to flush.
   FlushOutputQueue();
 
   if (stream->RequestBlockedOnRead()) {
-    
+
     // We are blocked waiting for input - either more http headers or
     // any request body data. When more data from the request stream
     // becomes available the httptransaction will call conn->ResumeSend().
-    
+
     LOG3(("SpdySession2::ReadSegments %p dealing with block on read", this));
 
     // call readsegments again if there are other streams ready
     // to run in this session
     if (GetWriteQueueSize())
       rv = NS_OK;
     else
       rv = NS_BASE_STREAM_WOULD_BLOCK;
     SetWriteCallbacks();
     return rv;
   }
-  
+
   if (NS_FAILED(rv)) {
     LOG3(("SpdySession2::ReadSegments %p returning FAIL code %X",
           this, rv));
     if (rv != NS_BASE_STREAM_WOULD_BLOCK)
       CleanupStream(stream, rv, RST_CANCEL);
     return rv;
   }
-  
+
   if (*countRead > 0) {
     LOG3(("SpdySession2::ReadSegments %p stream=%p generated end of frame %d",
           this, stream, *countRead));
     mReadyForWrite.Push(stream);
     SetWriteCallbacks();
     return rv;
   }
-  
+
   LOG3(("SpdySession2::ReadSegments %p stream=%p stream send complete",
         this, stream));
-  
+
   /* we now want to recv data */
   ResumeRecv();
 
   // call readsegments again if there are other streams ready
   // to go in this session
   SetWriteCallbacks();
 
   return rv;
@@ -1569,46 +1569,46 @@ SpdySession2::ReadSegments(nsAHttpSegmen
 
 // WriteSegments() is used to read data off the socket. Generally this is
 // just the SPDY frame header and from there the appropriate SPDYStream
 // is identified from the Stream-ID. The http transaction associated with
 // that read then pulls in the data directly, which it will feed to
 // OnWriteSegment(). That function will gateway it into http and feed
 // it to the appropriate transaction.
 
-// we call writer->OnWriteSegment via NetworkRead() to get a spdy header.. 
+// we call writer->OnWriteSegment via NetworkRead() to get a spdy header..
 // and decide if it is data or control.. if it is control, just deal with it.
 // if it is data, identify the spdy stream
 // call stream->WriteSegemnts which can call this::OnWriteSegment to get the
 // data. It always gets full frames if they are part of the stream
 
 nsresult
 SpdySession2::WriteSegments(nsAHttpSegmentWriter *writer,
                            uint32_t count,
                            uint32_t *countWritten)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   nsresult rv;
   *countWritten = 0;
 
   if (mClosed)
     return NS_ERROR_FAILURE;
 
   SetWriteCallbacks();
-  
+
   // We buffer all control frames and act on them in this layer.
   // We buffer the first 8 bytes of data frames (the header) but
   // the actual data is passed through unprocessed.
-  
+
   if (mDownstreamState == BUFFERING_FRAME_HEADER) {
     // The first 8 bytes of every frame is header information that
     // we are going to want to strip before passing to http. That is
     // true of both control and data packets.
-    
+
     MOZ_ASSERT(mInputFrameBufferUsed < 8,
                "Frame Buffer Used Too Large for State");
 
     rv = NetworkRead(writer, mInputFrameBuffer + mInputFrameBufferUsed,
                      8 - mInputFrameBufferUsed, countWritten);
 
     if (NS_FAILED(rv)) {
       LOG3(("SpdySession2 %p buffering frame header read failure %x\n",
@@ -1633,31 +1633,31 @@ SpdySession2::WriteSegments(nsAHttpSegme
     }
 
     // For both control and data frames the second 32 bit word of the header
     // is 8-flags, 24-length. (network byte order)
     mInputFrameDataSize =
       PR_ntohl(reinterpret_cast<uint32_t *>(mInputFrameBuffer.get())[1]);
     mInputFrameDataSize &= 0x00ffffff;
     mInputFrameDataRead = 0;
-    
+
     if (mInputFrameBuffer[0] & kFlag_Control) {
       EnsureBuffer(mInputFrameBuffer, mInputFrameDataSize + 8, 8,
                    mInputFrameBufferSize);
       ChangeDownstreamState(BUFFERING_CONTROL_FRAME);
-      
+
       // The first 32 bit word of the header is
       // 1 ctrl - 15 version - 16 type
       uint16_t version =
         PR_ntohs(reinterpret_cast<uint16_t *>(mInputFrameBuffer.get())[0]);
       version &= 0x7fff;
-      
+
       mFrameControlType =
         PR_ntohs(reinterpret_cast<uint16_t *>(mInputFrameBuffer.get())[1]);
-      
+
       LOG3(("SpdySession2::WriteSegments %p - Control Frame Identified "
             "type %d version %d data len %d",
             this, mFrameControlType, version, mInputFrameDataSize));
 
       if (mFrameControlType >= CONTROL_TYPE_LAST ||
           mFrameControlType <= CONTROL_TYPE_FIRST)
         return NS_ERROR_ILLEGAL_VALUE;
 
@@ -1752,17 +1752,17 @@ SpdySession2::WriteSegments(nsAHttpSegme
             "stream->writeSegments returning BASE_STREAM_CLOSED\n",
             this, stream, stream ? stream->StreamID() : 0,
             mNeedsCleanup));
       CleanupStream(stream, NS_OK, RST_CANCEL);
       MOZ_ASSERT(!mNeedsCleanup, "double cleanup out of data frame");
       mNeedsCleanup = nullptr;                     /* just in case */
       return NS_OK;
     }
-    
+
     if (mNeedsCleanup) {
       LOG3(("SpdySession2::WriteSegments session=%p stream=%p 0x%X "
             "cleanup stream based on mNeedsCleanup.\n",
             this, mNeedsCleanup, mNeedsCleanup ? mNeedsCleanup->StreamID() : 0));
       CleanupStream(mNeedsCleanup, NS_OK, RST_CANCEL);
       mNeedsCleanup = nullptr;
     }
 
@@ -1794,17 +1794,17 @@ SpdySession2::WriteSegments(nsAHttpSegme
     LogIO(this, nullptr, "Discarding Frame", trash, *countWritten);
 
     mInputFrameDataRead += *countWritten;
 
     if (mInputFrameDataRead == mInputFrameDataSize)
       ResetDownstreamState();
     return rv;
   }
-  
+
   if (mDownstreamState != BUFFERING_CONTROL_FRAME) {
     // this cannot happen
     MOZ_ASSERT(false, "Not in Bufering Control Frame State");
     return NS_ERROR_UNEXPECTED;
   }
 
   MOZ_ASSERT(mInputFrameBufferUsed == 8,
              "Frame Buffer Header Not Present");
@@ -1828,17 +1828,17 @@ SpdySession2::WriteSegments(nsAHttpSegme
 
   if (mInputFrameDataRead != mInputFrameDataSize)
     return NS_OK;
 
   // This check is actually redundant, the control type was previously
   // checked to make sure it was in range, but we will check it again
   // at time of use to make sure a regression doesn't creep in.
   if (mFrameControlType >= CONTROL_TYPE_LAST ||
-      mFrameControlType <= CONTROL_TYPE_FIRST) 
+      mFrameControlType <= CONTROL_TYPE_FIRST)
   {
     MOZ_ASSERT(false, "control type out of range");
     return NS_ERROR_ILLEGAL_VALUE;
   }
   rv = sControlFunctions[mFrameControlType](this);
 
   MOZ_ASSERT(NS_FAILED(rv) ||
              mDownstreamState != BUFFERING_CONTROL_FRAME,
@@ -1901,59 +1901,59 @@ SpdySession2::CloseTransaction(nsAHttpTr
 //-----------------------------------------------------------------------------
 
 nsresult
 SpdySession2::OnReadSegment(const char *buf,
                            uint32_t count,
                            uint32_t *countRead)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   nsresult rv;
-  
+
   // If we can release old queued data then we can try and write the new
   // data directly to the network without using the output queue at all
   if (mOutputQueueUsed)
     FlushOutputQueue();
 
   if (!mOutputQueueUsed && mSegmentReader) {
     // try and write directly without output queue
     rv = mSegmentReader->OnReadSegment(buf, count, countRead);
 
     if (rv == NS_BASE_STREAM_WOULD_BLOCK)
       *countRead = 0;
     else if (NS_FAILED(rv))
       return rv;
-    
+
     if (*countRead < count) {
       uint32_t required = count - *countRead;
       // assuming a commitment() happened, this ensurebuffer is a nop
       // but just in case the queuesize is too small for the required data
       // call ensurebuffer().
       EnsureBuffer(mOutputQueueBuffer, required, 0, mOutputQueueSize);
       memcpy(mOutputQueueBuffer.get(), buf + *countRead, required);
       mOutputQueueUsed = required;
     }
-    
+
     *countRead = count;
     return NS_OK;
   }
 
   // At this point we are going to buffer the new data in the output
   // queue if it fits. By coalescing multiple small submissions into one larger
   // buffer we can get larger writes out to the network later on.
 
   // This routine should not be allowed to fill up the output queue
   // all on its own - at least kQueueReserved bytes are always left
   // for other routines to use - but this is an all-or-nothing function,
   // so if it will not all fit just return WOULD_BLOCK
 
   if ((mOutputQueueUsed + count) > (mOutputQueueSize - kQueueReserved))
     return NS_BASE_STREAM_WOULD_BLOCK;
-  
+
   memcpy(mOutputQueueBuffer.get() + mOutputQueueUsed, buf, count);
   mOutputQueueUsed += count;
   *countRead = count;
 
   FlushOutputQueue();
 
   return NS_OK;
 }
@@ -2005,52 +2005,52 @@ SpdySession2::OnWriteSegment(char *buf,
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   nsresult rv;
 
   if (!mSegmentWriter) {
     // the only way this could happen would be if Close() were called on the
     // stack with WriteSegments()
     return NS_ERROR_FAILURE;
   }
-  
+
   if (mDownstreamState == PROCESSING_DATA_FRAME) {
 
     if (mInputFrameDataLast &&
         mInputFrameDataRead == mInputFrameDataSize) {
       *countWritten = 0;
       SetNeedsCleanup();
       return NS_BASE_STREAM_CLOSED;
     }
-    
+
     count = std::min(count, mInputFrameDataSize - mInputFrameDataRead);
     rv = NetworkRead(mSegmentWriter, buf, count, countWritten);
     if (NS_FAILED(rv))
       return rv;
 
     LogIO(this, mInputFrameDataStream, "Reading Data Frame",
           buf, *countWritten);
 
     mInputFrameDataRead += *countWritten;
-    
+
     mInputFrameDataStream->UpdateTransportReadEvents(*countWritten);
     if ((mInputFrameDataRead == mInputFrameDataSize) && !mInputFrameDataLast)
       ResetDownstreamState();
 
     return rv;
   }
-  
+
   if (mDownstreamState == PROCESSING_CONTROL_SYN_REPLY) {
-    
+
     if (mFlatHTTPResponseHeaders.Length() == mFlatHTTPResponseHeadersOut &&
         mInputFrameDataLast) {
       *countWritten = 0;
       SetNeedsCleanup();
       return NS_BASE_STREAM_CLOSED;
     }
-      
+
     count = std::min(count,
                    mFlatHTTPResponseHeaders.Length() -
                    mFlatHTTPResponseHeadersOut);
     memcpy(buf,
            mFlatHTTPResponseHeaders.get() + mFlatHTTPResponseHeadersOut,
            count);
     mFlatHTTPResponseHeadersOut += count;
     *countWritten = count;
@@ -2091,17 +2091,17 @@ SpdySession2::TransactionHasDataToWrite(
   // it is no longer blocked on read.
 
   SpdyStream2 *stream = mStreamTransactionHash.Get(caller);
   if (!stream || !VerifyStream(stream)) {
     LOG3(("SpdySession2::TransactionHasDataToWrite %p caller %p not found",
           this, caller));
     return;
   }
-  
+
   LOG3(("SpdySession2::TransactionHasDataToWrite %p ID is %x",
         this, stream->StreamID()));
 
   mReadyForWrite.Push(stream);
 }
 
 void
 SpdySession2::TransactionHasDataToWrite(SpdyStream2 *stream)
--- a/netwerk/protocol/http/SpdySession2.h
+++ b/netwerk/protocol/http/SpdySession2.h
@@ -41,31 +41,31 @@ public:
   ~SpdySession2();
 
   bool AddStream(nsAHttpTransaction *, int32_t);
   bool CanReuse() { return !mShouldGoAway && !mClosed; }
   bool RoomForMoreStreams();
 
   // When the connection is active this is called every 1 second
   void ReadTimeoutTick(PRIntervalTime now);
-  
+
   // Idle time represents time since "goodput".. e.g. a data or header frame
   PRIntervalTime IdleTime();
 
   uint32_t RegisterStreamID(SpdyStream2 *);
 
   const static uint8_t kFlag_Control   = 0x80;
 
   const static uint8_t kFlag_Data_FIN  = 0x01;
   const static uint8_t kFlag_Data_UNI  = 0x02;
   const static uint8_t kFlag_Data_ZLIB = 0x02;
-  
+
   // The protocol document for v2 specifies that the
   // highest value (3) is the highest priority, but in
-  // reality 0 is the highest priority. 
+  // reality 0 is the highest priority.
   //
   // Draft 3 notes here https://sites.google.com/a/chromium.org/dev/spdy/spdy-protocol/
   // are the best guide to the mistake. Also see
   // GetLowestPriority() and GetHighestPriority() in spdy_framer.h of
   // chromium source.
 
   const static uint8_t kPri00   = 0 << 6; // highest
   const static uint8_t kPri01   = 1 << 6;
@@ -119,21 +119,21 @@ public:
   // kDefaultQueueSize must be >= other queue size constants
   const static uint32_t kDefaultQueueSize =  32768;
   const static uint32_t kQueueMinimumCleanup = 24576;
   const static uint32_t kQueueTailRoom    =  4096;
   const static uint32_t kQueueReserved    =  1024;
 
   const static uint32_t kDefaultMaxConcurrent = 100;
   const static uint32_t kMaxStreamID = 0x7800000;
-  
+
   // This is a sentinel for a deleted stream. It is not a valid
   // 31 bit stream ID.
   const static uint32_t kDeadStreamID = 0xffffdead;
-  
+
   static nsresult HandleSynStream(SpdySession2 *);
   static nsresult HandleSynReply(SpdySession2 *);
   static nsresult HandleRstStream(SpdySession2 *);
   static nsresult HandleSettings(SpdySession2 *);
   static nsresult HandleNoop(SpdySession2 *);
   static nsresult HandlePing(SpdySession2 *);
   static nsresult HandleGoAway(SpdySession2 *);
   static nsresult HandleHeaders(SpdySession2 *);
@@ -149,17 +149,17 @@ public:
   // an overload of nsAHttpConnection
   void TransactionHasDataToWrite(nsAHttpTransaction *);
 
   // a similar version for SpdyStream2
   void TransactionHasDataToWrite(SpdyStream2 *);
 
   // an overload of nsAHttpSegementReader
   virtual nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment);
-  
+
   void     PrintDiagnostics (nsCString &log);
 
 private:
 
   enum stateType {
     BUFFERING_FRAME_HEADER,
     BUFFERING_CONTROL_FRAME,
     PROCESSING_DATA_FRAME,
@@ -192,17 +192,17 @@ private:
   void        ProcessPending();
   nsresult    SetInputFrameDataStream(uint32_t);
   bool        VerifyStream(SpdyStream2 *, uint32_t);
   void        SetNeedsCleanup();
 
   // a wrapper for all calls to the nshttpconnection level segment writer. Used
   // to track network I/O for timeout purposes
   nsresult   NetworkRead(nsAHttpSegmentWriter *, char *, uint32_t, uint32_t *);
-  
+
   static PLDHashOperator ShutdownEnumerator(nsAHttpTransaction *,
                                             nsAutoPtr<SpdyStream2> &,
                                             void *);
 
   static PLDHashOperator GoAwayEnumerator(nsAHttpTransaction *,
                                           nsAutoPtr<SpdyStream2> &,
                                           void *);
 
@@ -251,29 +251,29 @@ private:
   z_stream            mDownstreamZlib;
   z_stream            mUpstreamZlib;
 
   // mInputFrameBuffer is used to store received control packets and the 8 bytes
   // of header on data packets
   uint32_t             mInputFrameBufferSize;
   uint32_t             mInputFrameBufferUsed;
   nsAutoArrayPtr<char> mInputFrameBuffer;
-  
+
   // mInputFrameDataSize/Read are used for tracking the amount of data consumed
   // in a data frame. the data itself is not buffered in spdy
   // The frame size is mInputFrameDataSize + the constant 8 byte header
   uint32_t             mInputFrameDataSize;
   uint32_t             mInputFrameDataRead;
   bool                 mInputFrameDataLast; // This frame was marked FIN
 
   // When a frame has been received that is addressed to a particular stream
   // (e.g. a data frame after the stream-id has been decoded), this points
   // to the stream.
   SpdyStream2          *mInputFrameDataStream;
-  
+
   // mNeedsCleanup is a state variable to defer cleanup of a closed stream
   // If needed, It is set in session::OnWriteSegments() and acted on and
   // cleared when the stack returns to session::WriteSegments(). The stream
   // cannot be destroyed directly out of OnWriteSegments because
   // stream::writeSegments() is on the stack at that time.
   SpdyStream2          *mNeedsCleanup;
 
   // The CONTROL_TYPE value for a control frame
--- a/netwerk/protocol/http/SpdySession3.cpp
+++ b/netwerk/protocol/http/SpdySession3.cpp
@@ -62,41 +62,41 @@ SpdySession3::SpdySession3(nsAHttpTransa
     mLastReadEpoch(PR_IntervalNow()),
     mPingSentEpoch(0),
     mNextPingID(1)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
   LOG3(("SpdySession3::SpdySession3 %p transaction 1 = %p",
         this, aHttpTransaction));
-  
+
   mStreamIDHash.Init();
   mStreamTransactionHash.Init();
   mConnection = aHttpTransaction->Connection();
   mInputFrameBuffer = new char[mInputFrameBufferSize];
   mOutputQueueBuffer = new char[mOutputQueueSize];
   zlibInit();
-  
+
   mSendingChunkSize = gHttpHandler->SpdySendingChunkSize();
   GenerateSettings();
 
   if (!aHttpTransaction->IsNullTransaction())
     AddStream(aHttpTransaction, firstPriority);
   mLastDataReadEpoch = mLastReadEpoch;
-  
+
   mPingThreshold = gHttpHandler->SpdyPingThreshold();
 }
 
 PLDHashOperator
 SpdySession3::ShutdownEnumerator(nsAHttpTransaction *key,
                                 nsAutoPtr<SpdyStream3> &stream,
                                 void *closure)
 {
   SpdySession3 *self = static_cast<SpdySession3 *>(closure);
- 
+
   // On a clean server hangup the server sets the GoAwayID to be the ID of
   // the last transaction it processed. If the ID of stream in the
   // local stream is greater than that it can safely be restarted because the
   // server guarantees it was not partially processed. Streams that have not
   // registered an ID haven't actually been sent yet so they can always be
   // restarted.
   if (self->mCleanShutdown &&
       (stream->StreamID() > self->mGoAwayID || !stream->HasRegisteredID()))
@@ -125,31 +125,31 @@ SpdySession3::GoAwayEnumerator(nsAHttpTr
 
 SpdySession3::~SpdySession3()
 {
   LOG3(("SpdySession3::~SpdySession3 %p mDownstreamState=%X",
         this, mDownstreamState));
 
   inflateEnd(&mDownstreamZlib);
   deflateEnd(&mUpstreamZlib);
-  
+
   mStreamTransactionHash.Enumerate(ShutdownEnumerator, this);
   Telemetry::Accumulate(Telemetry::SPDY_PARALLEL_STREAMS, mConcurrentHighWater);
   Telemetry::Accumulate(Telemetry::SPDY_REQUEST_PER_CONN, (mNextStreamID - 1) / 2);
   Telemetry::Accumulate(Telemetry::SPDY_SERVER_INITIATED_STREAMS,
                         mServerPushedResources);
 }
 
 void
 SpdySession3::LogIO(SpdySession3 *self, SpdyStream3 *stream, const char *label,
                    const char *data, uint32_t datalen)
 {
   if (!LOG4_ENABLED())
     return;
-  
+
   LOG4(("SpdySession3::LogIO %p stream=%p id=0x%X [%s]",
         self, stream, stream ? stream->StreamID() : 0, label));
 
   // Max line is (16 * 3) + 10(prefix) + newline + null
   char linebuf[128];
   uint32_t index;
   char *line = linebuf;
 
@@ -171,17 +171,17 @@ SpdySession3::LogIO(SpdySession3 *self, 
   }
   if (index) {
     *line = 0;
     LOG4(("%s", linebuf));
   }
 }
 
 typedef nsresult  (*Control_FX) (SpdySession3 *self);
-static Control_FX sControlFunctions[] = 
+static Control_FX sControlFunctions[] =
 {
   nullptr,
   SpdySession3::HandleSynStream,
   SpdySession3::HandleSynReply,
   SpdySession3::HandleRstStream,
   SpdySession3::HandleSettings,
   SpdySession3::HandleNoop,
   SpdySession3::HandlePing,
@@ -237,17 +237,17 @@ SpdySession3::ReadTimeoutTick(PRInterval
       if ((now - mPingSentEpoch) >= gHttpHandler->SpdyPingTimeout()) {
         LOG(("SpdySession3::ReadTimeoutTick %p Ping Timer Exhaustion\n",
              this));
         mPingSentEpoch = 0;
         Close(NS_ERROR_NET_TIMEOUT);
       }
       return;
     }
-    
+
     LOG(("SpdySession3::ReadTimeoutTick %p generating ping 0x%X\n",
          this, mNextPingID));
 
     if (mNextPingID == 0xffffffff) {
       LOG(("SpdySession3::ReadTimeoutTick %p cannot form ping - ids exhausted\n",
            this));
       return;
     }
@@ -271,17 +271,17 @@ SpdySession3::RegisterStreamID(SpdyStrea
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
   LOG3(("SpdySession3::RegisterStreamID session=%p stream=%p id=0x%X "
         "concurrent=%d",this, stream, mNextStreamID, mConcurrent));
 
   MOZ_ASSERT(mNextStreamID < 0xfffffff0,
              "should have stopped admitting streams");
-  
+
   uint32_t result = mNextStreamID;
   mNextStreamID += 2;
 
   // We've used up plenty of ID's on this session. Start
   // moving to a new one before there is a crunch involving
   // server push streams or concurrent non-registered submits
   if (mNextStreamID >= kMaxStreamID)
     mShouldGoAway = true;
@@ -329,17 +329,17 @@ SpdySession3::AddStream(nsAHttpTransacti
           this, stream));
     ActivateStream(stream);
   }
   else {
     LOG3(("SpdySession3::AddStream %p stream %p queued.",
           this, stream));
     mQueuedStreams.Push(stream);
   }
-  
+
   return true;
 }
 
 void
 SpdySession3::ActivateStream(SpdyStream3 *stream)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
@@ -411,42 +411,42 @@ SpdySession3::RealignOutputQueue()
   mOutputQueueSent = 0;
 }
 
 void
 SpdySession3::FlushOutputQueue()
 {
   if (!mSegmentReader || !mOutputQueueUsed)
     return;
-  
+
   nsresult rv;
   uint32_t countRead;
   uint32_t avail = mOutputQueueUsed - mOutputQueueSent;
 
   rv = mSegmentReader->
     OnReadSegment(mOutputQueueBuffer.get() + mOutputQueueSent, avail,
                                      &countRead);
   LOG3(("SpdySession3::FlushOutputQueue %p sz=%d rv=%x actual=%d",
         this, avail, rv, countRead));
-  
+
   // Dont worry about errors on write, we will pick this up as a read error too
   if (NS_FAILED(rv))
     return;
-  
+
   if (countRead == avail) {
     mOutputQueueUsed = 0;
     mOutputQueueSent = 0;
     return;
   }
 
   mOutputQueueSent += countRead;
 
   // If the output queue is close to filling up and we have sent out a good
   // chunk of data from the beginning then realign it.
-  
+
   if ((mOutputQueueSent >= kQueueMinimumCleanup) &&
       ((mOutputQueueSize - mOutputQueueUsed) < kQueueTailRoom)) {
     RealignOutputQueue();
   }
 }
 
 void
 SpdySession3::DontReuse()
@@ -497,17 +497,17 @@ SpdySession3::ResetDownstreamState()
 template<typename T> void
 SpdySession3::EnsureBuffer(nsAutoArrayPtr<T> &buf,
                           uint32_t newSize,
                           uint32_t preserve,
                           uint32_t &objSize)
 {
   if (objSize >= newSize)
       return;
-  
+
   // Leave a little slop on the new allocation - add 2KB to
   // what we need and then round the result up to a 4KB (page)
   // boundary.
 
   objSize = (newSize + 2048 + 4095) & ~4095;
 
   MOZ_STATIC_ASSERT(sizeof(T) == 1, "sizeof(T) must be 1");
   nsAutoArrayPtr<T> tmp(new T[objSize]);
@@ -566,17 +566,17 @@ SpdySession3::UncompressAndDiscard(uint3
     mDownstreamZlib.avail_out = sizeof(trash);
     int zlib_rv = inflate(&mDownstreamZlib, Z_NO_FLUSH);
 
     if (zlib_rv == Z_NEED_DICT) {
       if (triedDictionary) {
         LOG3(("SpdySession3::UncompressAndDiscard %p Dictionary Error\n", this));
         return NS_ERROR_FAILURE;
       }
-      
+
       triedDictionary = true;
       inflateSetDictionary(&mDownstreamZlib, SpdyStream3::kDictionary,
                            sizeof(SpdyStream3::kDictionary));
     }
 
     if (zlib_rv == Z_DATA_ERROR || zlib_rv == Z_MEM_ERROR)
       return NS_ERROR_FAILURE;
   }
@@ -598,17 +598,17 @@ SpdySession3::GeneratePing(uint32_t aID)
   packet[0] = kFlag_Control;
   packet[1] = kVersion;
   packet[2] = 0;
   packet[3] = CONTROL_TYPE_PING;
   packet[4] = 0;                                  /* flags */
   packet[5] = 0;
   packet[6] = 0;
   packet[7] = 4;                                  /* length */
-  
+
   aID = PR_htonl(aID);
   memcpy(packet + 8, &aID, 4);
 
   LogIO(this, nullptr, "Generate Ping", packet, 12);
   FlushOutputQueue();
 }
 
 void
@@ -625,17 +625,17 @@ SpdySession3::GenerateRstStream(uint32_t
   packet[0] = kFlag_Control;
   packet[1] = kVersion;
   packet[2] = 0;
   packet[3] = CONTROL_TYPE_RST_STREAM;
   packet[4] = 0;                                  /* flags */
   packet[5] = 0;
   packet[6] = 0;
   packet[7] = 8;                                  /* length */
-  
+
   aID = PR_htonl(aID);
   memcpy(packet + 8, &aID, 4);
   aStatusCode = PR_htonl(aStatusCode);
   memcpy(packet + 12, &aStatusCode, 4);
 
   LogIO(this, nullptr, "Generate Reset", packet, 16);
   FlushOutputQueue();
 }
@@ -651,17 +651,17 @@ SpdySession3::GenerateGoAway(uint32_t aS
   char *packet = mOutputQueueBuffer.get() + mOutputQueueUsed;
   mOutputQueueUsed += 16;
 
   memset(packet, 0, 16);
   packet[0] = kFlag_Control;
   packet[1] = kVersion;
   packet[3] = CONTROL_TYPE_GOAWAY;
   packet[7] = 8;                                  /* data length */
-  
+
   // last-good-stream-id are bytes 8-11, when we accept server push this will
   // need to be set non zero
 
   // bytes 12-15 are the status code.
   aStatusCode = PR_htonl(aStatusCode);
   memcpy(packet + 12, &aStatusCode, 4);
 
   LogIO(this, nullptr, "Generate GoAway", packet, 16);
@@ -705,17 +705,17 @@ SpdySession3::GenerateSettings()
   if (cwnd) {
     packet[12 + 8 * numberOfEntries] = PERSISTED_VALUE;
     packet[15 + 8 * numberOfEntries] = SETTINGS_TYPE_CWND;
     LOG(("SpdySession3::GenerateSettings %p sending CWND %u\n", this, cwnd));
     cwnd = PR_htonl(cwnd);
     memcpy(packet + 16 + 8 * numberOfEntries, &cwnd, 4);
     numberOfEntries++;
   }
-  
+
   packet[15 + 8 * numberOfEntries] = SETTINGS_TYPE_INITIAL_WINDOW;
   uint32_t rwin = PR_htonl(kInitialRwin);
   memcpy(packet + 16 + 8 * numberOfEntries, &rwin, 4);
   numberOfEntries++;
 
   uint32_t dataLen = 4 + 8 * numberOfEntries;
   mOutputQueueUsed += 8 + dataLen;
   packet[7] = dataLen;
@@ -737,31 +737,31 @@ SpdySession3::VerifyStream(SpdyStream3 *
   // Only do the real verification in debug builds
   return true;
 #endif
 
   if (!aStream)
     return true;
 
   uint32_t test = 0;
-  
+
   do {
     if (aStream->StreamID() == kDeadStreamID)
       break;
 
     nsAHttpTransaction *trans = aStream->Transaction();
 
-    test++;  
+    test++;
     if (!trans)
       break;
 
     test++;
     if (mStreamTransactionHash.Get(trans) != aStream)
       break;
-    
+
     if (aStream->StreamID()) {
       SpdyStream3 *idStream = mStreamIDHash.Get(aStream->StreamID());
 
       test++;
       if (idStream != aStream)
         break;
 
       if (aOptionalID) {
@@ -798,17 +798,17 @@ SpdySession3::CleanupStream(SpdyStream3 
 
   if (!aStream->RecvdFin() && aStream->StreamID()) {
     LOG3(("Stream had not processed recv FIN, sending RST code %X\n",
           aResetCode));
     GenerateRstStream(aResetCode, aStream->StreamID());
     --mConcurrent;
     ProcessPending();
   }
-  
+
   CloseStream(aStream, aResult);
 
   // Remove the stream from the ID hash table. (this one isn't short, which is
   // why it is hashed.)
   mStreamIDHash.Remove(aStream->StreamID());
 
   // removing from the stream transaction hash will
   // delete the SpdyStream3 and drop the reference to
@@ -854,32 +854,32 @@ SpdySession3::CloseStream(SpdyStream3 *a
   // Send the stream the close() indication
   aStream->Close(aResult);
 }
 
 nsresult
 SpdySession3::HandleSynStream(SpdySession3 *self)
 {
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_SYN_STREAM);
-  
+
   if (self->mInputFrameDataSize < 18) {
     LOG3(("SpdySession3::HandleSynStream %p SYN_STREAM too short data=%d",
           self, self->mInputFrameDataSize));
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   uint32_t streamID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[2]);
   uint32_t associatedID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[3]);
 
   LOG3(("SpdySession3::HandleSynStream %p recv SYN_STREAM (push) "
         "for ID 0x%X associated with 0x%X.",
         self, streamID, associatedID));
-    
+
   if (streamID & 0x01) {                   // test for odd stream ID
     LOG3(("SpdySession3::HandleSynStream %p recvd SYN_STREAM id must be even.",
           self));
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   ++(self->mServerPushedResources);
 
@@ -922,17 +922,17 @@ SpdySession3::HandleSynReply(SpdySession
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_SYN_REPLY);
 
   if (self->mInputFrameDataSize < 4) {
     LOG3(("SpdySession3::HandleSynReply %p SYN REPLY too short data=%d",
           self, self->mInputFrameDataSize));
     // A framing error is a session wide error that cannot be recovered
     return NS_ERROR_ILLEGAL_VALUE;
   }
-  
+
   LOG3(("SpdySession3::HandleSynReply %p lookup via streamID in syn_reply.\n",
         self));
   uint32_t streamID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[2]);
   nsresult rv = self->SetInputFrameDataStream(streamID);
   if (NS_FAILED(rv))
     return rv;
 
@@ -941,17 +941,17 @@ SpdySession3::HandleSynReply(SpdySession
     // uncompress the header block to maintain the correct compression context
 
     LOG3(("SpdySession3::HandleSynReply %p lookup streamID in syn_reply "
           "0x%X failed. NextStreamID = 0x%X\n",
           self, streamID, self->mNextStreamID));
 
     if (streamID >= self->mNextStreamID)
       self->GenerateRstStream(RST_INVALID_STREAM, streamID);
-    
+
     if (NS_FAILED(self->UncompressAndDiscard(12,
                                              self->mInputFrameDataSize - 4))) {
       LOG(("SpdySession3::HandleSynReply uncompress failed\n"));
       // this is fatal to the session
       return NS_ERROR_FAILURE;
     }
 
     self->ResetDownstreamState();
@@ -984,17 +984,17 @@ SpdySession3::HandleSynReply(SpdySession
     // If the stream is half closed then RST_STREAM with STREAM_ALREADY_CLOSED
     // abort the session
     //
     LOG3(("SpdySession3::HandleSynReply %p dup SYN_REPLY for 0x%X"
           " recvdfin=%d", self, self->mInputFrameDataStream->StreamID(),
           self->mInputFrameDataStream->RecvdFin()));
 
     self->CleanupStream(self->mInputFrameDataStream, NS_ERROR_ALREADY_OPENED,
-                        self->mInputFrameDataStream->RecvdFin() ? 
+                        self->mInputFrameDataStream->RecvdFin() ?
                         RST_STREAM_ALREADY_CLOSED : RST_STREAM_IN_USE);
     self->ResetDownstreamState();
     return NS_OK;
   }
   self->mInputFrameDataStream->SetFullyOpen();
 
   self->mInputFrameDataLast = self->mInputFrameBuffer[4] & kFlag_Data_FIN;
   self->mInputFrameDataStream->UpdateTransportReadEvents(self->mInputFrameDataSize);
@@ -1071,17 +1071,17 @@ SpdySession3::HandleRstStream(SpdySessio
   LOG3(("SpdySession3::HandleRstStream %p RST_STREAM Reason Code %u ID %x "
         "flags %x", self, self->mDownstreamRstReason, streamID, flags));
 
   if (flags != 0) {
     LOG3(("SpdySession3::HandleRstStream %p RST_STREAM with flags is illegal",
           self));
     return NS_ERROR_ILLEGAL_VALUE;
   }
-  
+
   if (self->mDownstreamRstReason == RST_INVALID_STREAM ||
       self->mDownstreamRstReason == RST_STREAM_IN_USE ||
       self->mDownstreamRstReason == RST_FLOW_CONTROL_ERROR) {
     // basically just ignore this
     LOG3(("SpdySession3::HandleRstStream %p No Reset Processing Needed.\n"));
     self->ResetDownstreamState();
     return NS_OK;
   }
@@ -1150,63 +1150,63 @@ SpdySession3::HandleSettings(SpdySession
 
     LOG3(("Settings ID %d, Flags %X, Value %d", id, flags, value));
 
     switch (id)
     {
     case SETTINGS_TYPE_UPLOAD_BW:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_UL_BW, value);
       break;
-      
+
     case SETTINGS_TYPE_DOWNLOAD_BW:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_DL_BW, value);
       break;
-      
+
     case SETTINGS_TYPE_RTT:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_RTT, value);
       break;
-      
+
     case SETTINGS_TYPE_MAX_CONCURRENT:
       self->mMaxConcurrent = value;
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_MAX_STREAMS, value);
       break;
 
-    case SETTINGS_TYPE_CWND: 
+    case SETTINGS_TYPE_CWND:
       if (flags & PERSIST_VALUE)
       {
         nsRefPtr<nsHttpConnectionInfo> ci;
         self->GetConnectionInfo(getter_AddRefs(ci));
         if (ci)
           gHttpHandler->ConnMgr()->ReportSpdyCWNDSetting(ci, value);
       }
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_CWND, value);
       break;
 
     case SETTINGS_TYPE_DOWNLOAD_RETRANS_RATE:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_RETRANS, value);
       break;
-      
+
     case SETTINGS_TYPE_INITIAL_WINDOW:
       Telemetry::Accumulate(Telemetry::SPDY_SETTINGS_IW, value >> 10);
       {
         int32_t delta = value - self->mServerInitialWindow;
         self->mServerInitialWindow = value;
 
         // we need to add the delta to all open streams (delta can be negative)
         self->mStreamTransactionHash.Enumerate(UpdateServerRwinEnumerator,
                                                &delta);
       }
       break;
-      
+
     default:
       break;
     }
-    
+
   }
-  
+
   self->ResetDownstreamState();
   return NS_OK;
 }
 
 nsresult
 SpdySession3::HandleNoop(SpdySession3 *self)
 {
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_NOOP);
@@ -1239,17 +1239,17 @@ SpdySession3::HandlePing(SpdySession3 *s
   if (pingID & 0x01) {
     // presumably a reply to our timeout ping
     self->mPingSentEpoch = 0;
   }
   else {
     // Servers initiate even numbered pings, go ahead and echo it back
     self->GeneratePing(pingID);
   }
-    
+
   self->ResetDownstreamState();
   return NS_OK;
 }
 
 nsresult
 SpdySession3::HandleGoAway(SpdySession3 *self)
 {
   MOZ_ASSERT(self->mFrameControlType == CONTROL_TYPE_GOAWAY);
@@ -1260,17 +1260,17 @@ SpdySession3::HandleGoAway(SpdySession3 
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   self->mShouldGoAway = true;
   self->mGoAwayID =
     PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[2]);
   self->mCleanShutdown = true;
 
-  // Find streams greater than the last-good ID and mark them for deletion 
+  // Find streams greater than the last-good ID and mark them for deletion
   // in the mGoAwayStreamsToRestart queue with the GoAwayEnumerator. They can
   // be restarted.
   self->mStreamTransactionHash.Enumerate(GoAwayEnumerator, self);
 
   // Process the streams marked for deletion and restart.
   uint32_t size = self->mGoAwayStreamsToRestart.GetSize();
   for (uint32_t count = 0; count < size; ++count) {
     SpdyStream3 *stream =
@@ -1289,17 +1289,17 @@ SpdySession3::HandleGoAway(SpdySession3 
   for (uint32_t count = 0; count < size; ++count) {
     SpdyStream3 *stream =
       static_cast<SpdyStream3 *>(self->mQueuedStreams.PopFront());
     self->CloseStream(stream, NS_ERROR_NET_RESET);
     self->mStreamTransactionHash.Remove(stream->Transaction());
   }
 
   LOG3(("SpdySession3::HandleGoAway %p GOAWAY Last-Good-ID 0x%X status 0x%X "
-        "live streams=%d\n", self, self->mGoAwayID, 
+        "live streams=%d\n", self, self->mGoAwayID,
         PR_ntohl(reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get())[3]),
         self->mStreamTransactionHash.Count()));
 
   self->ResumeRecv();
   self->ResetDownstreamState();
   return NS_OK;
 }
 
@@ -1411,17 +1411,17 @@ SpdySession3::HandleWindowUpdate(SpdySes
     if (streamID >= self->mNextStreamID)
       self->GenerateRstStream(RST_INVALID_STREAM, streamID);
     self->ResetDownstreamState();
     return NS_OK;
   }
 
   int64_t oldRemoteWindow = self->mInputFrameDataStream->RemoteWindow();
   self->mInputFrameDataStream->UpdateRemoteWindow(delta);
-  
+
   LOG3(("SpdySession3::HandleWindowUpdate %p stream 0x%X window "
         "%d increased by %d.\n", self, streamID, oldRemoteWindow, delta));
 
   // If the stream had a <=0 window, that has now opened
   // schedule it for writing again
   if (oldRemoteWindow <= 0 &&
       self->mInputFrameDataStream->RemoteWindow() > 0) {
     self->mReadyForWrite.Push(self->mInputFrameDataStream);
@@ -1494,17 +1494,17 @@ SpdySession3::OnTransportStatus(nsITrans
 // generated instead.
 
 nsresult
 SpdySession3::ReadSegments(nsAHttpSegmentReader *reader,
                           uint32_t count,
                           uint32_t *countRead)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   MOZ_ASSERT(!mSegmentReader || !reader || (mSegmentReader == reader),
              "Inconsistent Write Function Callback");
 
   if (reader)
     mSegmentReader = reader;
 
   nsresult rv;
   *countRead = 0;
@@ -1514,17 +1514,17 @@ SpdySession3::ReadSegments(nsAHttpSegmen
   SpdyStream3 *stream = static_cast<SpdyStream3 *>(mReadyForWrite.PopFront());
   if (!stream) {
     LOG3(("SpdySession3 %p could not identify a stream to write; suspending.",
           this));
     FlushOutputQueue();
     SetWriteCallbacks();
     return NS_BASE_STREAM_WOULD_BLOCK;
   }
-  
+
   LOG3(("SpdySession3 %p will write from SpdyStream3 %p 0x%X "
         "block-input=%d block-output=%d\n", this, stream, stream->StreamID(),
         stream->RequestBlockedOnRead(), stream->BlockedOnRwin()));
 
   rv = stream->ReadSegments(this, count, countRead);
 
   // Not every permutation of stream->ReadSegents produces data (and therefore
   // tries to flush the output queue) - SENDING_FIN_STREAM can be an example
@@ -1532,102 +1532,102 @@ SpdySession3::ReadSegments(nsAHttpSegmen
   // to flush.
   FlushOutputQueue();
 
   // Allow new server reads - that might be data or control information
   // (e.g. window updates or http replies) that are responses to these writes
   ResumeRecv();
 
   if (stream->RequestBlockedOnRead()) {
-    
+
     // We are blocked waiting for input - either more http headers or
     // any request body data. When more data from the request stream
     // becomes available the httptransaction will call conn->ResumeSend().
-    
+
     LOG3(("SpdySession3::ReadSegments %p dealing with block on read", this));
 
     // call readsegments again if there are other streams ready
     // to run in this session
     if (GetWriteQueueSize())
       rv = NS_OK;
     else
       rv = NS_BASE_STREAM_WOULD_BLOCK;
     SetWriteCallbacks();
     return rv;
   }
-  
+
   if (NS_FAILED(rv)) {
     LOG3(("SpdySession3::ReadSegments %p returning FAIL code %X",
           this, rv));
     if (rv != NS_BASE_STREAM_WOULD_BLOCK)
       CleanupStream(stream, rv, RST_CANCEL);
     return rv;
   }
-  
+
   if (*countRead > 0) {
     LOG3(("SpdySession3::ReadSegments %p stream=%p countread=%d",
           this, stream, *countRead));
     mReadyForWrite.Push(stream);
     SetWriteCallbacks();
     return rv;
   }
 
   if (stream->BlockedOnRwin()) {
     LOG3(("SpdySession3 %p will stream %p 0x%X suspended for flow control\n",
           this, stream, stream->StreamID()));
     return NS_BASE_STREAM_WOULD_BLOCK;
   }
-  
+
   LOG3(("SpdySession3::ReadSegments %p stream=%p stream send complete",
         this, stream));
-  
+
   // call readsegments again if there are other streams ready
   // to go in this session
   SetWriteCallbacks();
 
   return rv;
 }
 
 // WriteSegments() is used to read data off the socket. Generally this is
 // just the SPDY frame header and from there the appropriate SPDYStream
 // is identified from the Stream-ID. The http transaction associated with
 // that read then pulls in the data directly, which it will feed to
 // OnWriteSegment(). That function will gateway it into http and feed
 // it to the appropriate transaction.
 
-// we call writer->OnWriteSegment via NetworkRead() to get a spdy header.. 
+// we call writer->OnWriteSegment via NetworkRead() to get a spdy header..
 // and decide if it is data or control.. if it is control, just deal with it.
 // if it is data, identify the spdy stream
 // call stream->WriteSegemnts which can call this::OnWriteSegment to get the
 // data. It always gets full frames if they are part of the stream
 
 nsresult
 SpdySession3::WriteSegments(nsAHttpSegmentWriter *writer,
                            uint32_t count,
                            uint32_t *countWritten)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   nsresult rv;
   *countWritten = 0;
 
   if (mClosed)
     return NS_ERROR_FAILURE;
 
   SetWriteCallbacks();
-  
+
   // We buffer all control frames and act on them in this layer.
   // We buffer the first 8 bytes of data frames (the header) but
   // the actual data is passed through unprocessed.
-  
+
   if (mDownstreamState == BUFFERING_FRAME_HEADER) {
     // The first 8 bytes of every frame is header information that
     // we are going to want to strip before passing to http. That is
     // true of both control and data packets.
-    
+
     MOZ_ASSERT(mInputFrameBufferUsed < 8,
                "Frame Buffer Used Too Large for State");
 
     rv = NetworkRead(writer, mInputFrameBuffer + mInputFrameBufferUsed,
                      8 - mInputFrameBufferUsed, countWritten);
 
     if (NS_FAILED(rv)) {
       LOG3(("SpdySession3 %p buffering frame header read failure %x\n",
@@ -1652,31 +1652,31 @@ SpdySession3::WriteSegments(nsAHttpSegme
     }
 
     // For both control and data frames the second 32 bit word of the header
     // is 8-flags, 24-length. (network byte order)
     mInputFrameDataSize =
       PR_ntohl(reinterpret_cast<uint32_t *>(mInputFrameBuffer.get())[1]);
     mInputFrameDataSize &= 0x00ffffff;
     mInputFrameDataRead = 0;
-    
+
     if (mInputFrameBuffer[0] & kFlag_Control) {
       EnsureBuffer(mInputFrameBuffer, mInputFrameDataSize + 8, 8,
                    mInputFrameBufferSize);
       ChangeDownstreamState(BUFFERING_CONTROL_FRAME);
-      
+
       // The first 32 bit word of the header is
       // 1 ctrl - 15 version - 16 type
       uint16_t version =
         PR_ntohs(reinterpret_cast<uint16_t *>(mInputFrameBuffer.get())[0]);
       version &= 0x7fff;
-      
+
       mFrameControlType =
         PR_ntohs(reinterpret_cast<uint16_t *>(mInputFrameBuffer.get())[1]);
-      
+
       LOG3(("SpdySession3::WriteSegments %p - Control Frame Identified "
             "type %d version %d data len %d",
             this, mFrameControlType, version, mInputFrameDataSize));
 
       if (mFrameControlType >= CONTROL_TYPE_LAST ||
           mFrameControlType <= CONTROL_TYPE_FIRST)
         return NS_ERROR_ILLEGAL_VALUE;
 
@@ -1795,17 +1795,17 @@ SpdySession3::WriteSegments(nsAHttpSegme
             "stream->writeSegments returning BASE_STREAM_CLOSED\n",
             this, stream, stream ? stream->StreamID() : 0,
             mNeedsCleanup));
       CleanupStream(stream, NS_OK, RST_CANCEL);
       MOZ_ASSERT(!mNeedsCleanup, "double cleanup out of data frame");
       mNeedsCleanup = nullptr;                     /* just in case */
       return NS_OK;
     }
-    
+
     if (mNeedsCleanup) {
       LOG3(("SpdySession3::WriteSegments session=%p stream=%p 0x%X "
             "cleanup stream based on mNeedsCleanup.\n",
             this, mNeedsCleanup, mNeedsCleanup ? mNeedsCleanup->StreamID() : 0));
       CleanupStream(mNeedsCleanup, NS_OK, RST_CANCEL);
       mNeedsCleanup = nullptr;
     }
 
@@ -1835,17 +1835,17 @@ SpdySession3::WriteSegments(nsAHttpSegme
     LogIO(this, nullptr, "Discarding Frame", trash, *countWritten);
 
     mInputFrameDataRead += *countWritten;
 
     if (mInputFrameDataRead == mInputFrameDataSize)
       ResetDownstreamState();
     return rv;
   }
-  
+
   if (mDownstreamState != BUFFERING_CONTROL_FRAME) {
     // this cannot happen
     MOZ_ASSERT(false, "Not in Bufering Control Frame State");
     return NS_ERROR_UNEXPECTED;
   }
 
   MOZ_ASSERT(mInputFrameBufferUsed == 8,
              "Frame Buffer Header Not Present");
@@ -1869,17 +1869,17 @@ SpdySession3::WriteSegments(nsAHttpSegme
 
   if (mInputFrameDataRead != mInputFrameDataSize)
     return NS_OK;
 
   // This check is actually redundant, the control type was previously
   // checked to make sure it was in range, but we will check it again
   // at time of use to make sure a regression doesn't creep in.
   if (mFrameControlType >= CONTROL_TYPE_LAST ||
-      mFrameControlType <= CONTROL_TYPE_FIRST) 
+      mFrameControlType <= CONTROL_TYPE_FIRST)
   {
     MOZ_ASSERT(false, "control type out of range");
     return NS_ERROR_ILLEGAL_VALUE;
   }
   rv = sControlFunctions[mFrameControlType](this);
 
   MOZ_ASSERT(NS_FAILED(rv) ||
              mDownstreamState != BUFFERING_CONTROL_FRAME,
@@ -1913,33 +1913,33 @@ SpdySession3::UpdateLocalRwin(SpdyStream
     PR_STATIC_ASSERT((kInitialRwin - kMinimumToAck) > 1024 * 1024);
 
     return;
   }
 
   // Generate window updates directly out of spdysession instead of the stream
   // in order to avoid queue delays in getting the ACK out.
   uint32_t toack = unacked & 0x7fffffff;
-  
+
   LOG3(("SpdySession3::UpdateLocalRwin Ack %p 0x%X %d\n",
         this, stream->StreamID(), toack));
   stream->IncrementLocalWindow(toack);
-    
+
   static const uint32_t dataLen = 8;
   EnsureBuffer(mOutputQueueBuffer, mOutputQueueUsed + 8 + dataLen,
                mOutputQueueUsed, mOutputQueueSize);
   char *packet = mOutputQueueBuffer.get() + mOutputQueueUsed;
   mOutputQueueUsed += 8 + dataLen;
 
   memset(packet, 0, 8 + dataLen);
   packet[0] = kFlag_Control;
   packet[1] = kVersion;
   packet[3] = CONTROL_TYPE_WINDOW_UPDATE;
   packet[7] = dataLen;
-  
+
   uint32_t id = PR_htonl(stream->StreamID());
   memcpy(packet + 8, &id, 4);
   toack = PR_htonl(toack);
   memcpy(packet + 12, &toack, 4);
 
   LogIO(this, stream, "Window Update", packet, 8 + dataLen);
   FlushOutputQueue();
 }
@@ -1996,59 +1996,59 @@ SpdySession3::CloseTransaction(nsAHttpTr
 //-----------------------------------------------------------------------------
 
 nsresult
 SpdySession3::OnReadSegment(const char *buf,
                            uint32_t count,
                            uint32_t *countRead)
 {
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   nsresult rv;
-  
+
   // If we can release old queued data then we can try and write the new
   // data directly to the network without using the output queue at all
   if (mOutputQueueUsed)
     FlushOutputQueue();
 
   if (!mOutputQueueUsed && mSegmentReader) {
     // try and write directly without output queue
     rv = mSegmentReader->OnReadSegment(buf, count, countRead);
 
     if (rv == NS_BASE_STREAM_WOULD_BLOCK)
       *countRead = 0;
     else if (NS_FAILED(rv))
       return rv;
-    
+
     if (*countRead < count) {
       uint32_t required = count - *countRead;
       // assuming a commitment() happened, this ensurebuffer is a nop
       // but just in case the queuesize is too small for the required data
       // call ensurebuffer().
       EnsureBuffer(mOutputQueueBuffer, required, 0, mOutputQueueSize);
       memcpy(mOutputQueueBuffer.get(), buf + *countRead, required);
       mOutputQueueUsed = required;
     }
-    
+
     *countRead = count;
     return NS_OK;
   }
 
   // At this point we are going to buffer the new data in the output
   // queue if it fits. By coalescing multiple small submissions into one larger
   // buffer we can get larger writes out to the network later on.
 
   // This routine should not be allowed to fill up the output queue
   // all on its own - at least kQueueReserved bytes are always left
   // for other routines to use - but this is an all-or-nothing function,
   // so if it will not all fit just return WOULD_BLOCK
 
   if ((mOutputQueueUsed + count) > (mOutputQueueSize - kQueueReserved))
     return NS_BASE_STREAM_WOULD_BLOCK;
-  
+
   memcpy(mOutputQueueBuffer.get() + mOutputQueueUsed, buf, count);
   mOutputQueueUsed += count;
   *countRead = count;
 
   FlushOutputQueue();
 
   return NS_OK;
 }
@@ -2100,52 +2100,52 @@ SpdySession3::OnWriteSegment(char *buf,
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   nsresult rv;
 
   if (!mSegmentWriter) {
     // the only way this could happen would be if Close() were called on the
     // stack with WriteSegments()
     return NS_ERROR_FAILURE;
   }
-  
+
   if (mDownstreamState == PROCESSING_DATA_FRAME) {
 
     if (mInputFrameDataLast &&
         mInputFrameDataRead == mInputFrameDataSize) {
       *countWritten = 0;
       SetNeedsCleanup();
       return NS_BASE_STREAM_CLOSED;
     }
-    
+
     count = std::min(count, mInputFrameDataSize - mInputFrameDataRead);
     rv = NetworkRead(mSegmentWriter, buf, count, countWritten);
     if (NS_FAILED(rv))
       return rv;
 
     LogIO(this, mInputFrameDataStream, "Reading Data Frame",
           buf, *countWritten);
 
     mInputFrameDataRead += *countWritten;
-    
+
     mInputFrameDataStream->UpdateTransportReadEvents(*countWritten);
     if ((mInputFrameDataRead == mInputFrameDataSize) && !mInputFrameDataLast)
       ResetDownstreamState();
 
     return rv;
   }
-  
+
   if (mDownstreamState == PROCESSING_COMPLETE_HEADERS) {
-    
+
     if (mFlatHTTPResponseHeaders.Length() == mFlatHTTPResponseHeadersOut &&
         mInputFrameDataLast) {
       *countWritten = 0;
       SetNeedsCleanup();
       return NS_BASE_STREAM_CLOSED;
     }
-      
+
     count = std::min(count,
                    mFlatHTTPResponseHeaders.Length() -
                    mFlatHTTPResponseHeadersOut);
     memcpy(buf,
            mFlatHTTPResponseHeaders.get() + mFlatHTTPResponseHeadersOut,
            count);
     mFlatHTTPResponseHeadersOut += count;
     *countWritten = count;
@@ -2161,17 +2161,17 @@ SpdySession3::OnWriteSegment(char *buf,
       else if (!mInputFrameDataLast) {
         // If more frames are expected in this stream, then reset the state so they can be
         // handled. Otherwise (e.g. a 0 length response with the fin on the SYN_REPLY)
         // stay in PROCESSING_COMPLETE_HEADERS state so the SetNeedsCleanup() code above can
         // cleanup the stream.
         ResetDownstreamState();
       }
     }
-    
+
     return NS_OK;
   }
 
   return NS_ERROR_UNEXPECTED;
 }
 
 void
 SpdySession3::SetNeedsCleanup()
@@ -2200,17 +2200,17 @@ SpdySession3::TransactionHasDataToWrite(
   // it is no longer blocked on read.
 
   SpdyStream3 *stream = mStreamTransactionHash.Get(caller);
   if (!stream || !VerifyStream(stream)) {
     LOG3(("SpdySession3::TransactionHasDataToWrite %p caller %p not found",
           this, caller));
     return;
   }
-  
+
   LOG3(("SpdySession3::TransactionHasDataToWrite %p ID is 0x%X\n",
         this, stream->StreamID()));
 
   mReadyForWrite.Push(stream);
 }
 
 void
 SpdySession3::TransactionHasDataToWrite(SpdyStream3 *stream)
--- a/netwerk/protocol/http/SpdySession3.h
+++ b/netwerk/protocol/http/SpdySession3.h
@@ -40,29 +40,29 @@ public:
   ~SpdySession3();
 
   bool AddStream(nsAHttpTransaction *, int32_t);
   bool CanReuse() { return !mShouldGoAway && !mClosed; }
   bool RoomForMoreStreams();
 
   // When the connection is active this is called every 1 second
   void ReadTimeoutTick(PRIntervalTime now);
-  
+
   // Idle time represents time since "goodput".. e.g. a data or header frame
   PRIntervalTime IdleTime();
 
   uint32_t RegisterStreamID(SpdyStream3 *);
 
   const static uint8_t kVersion        = 3;
 
   const static uint8_t kFlag_Control   = 0x80;
 
   const static uint8_t kFlag_Data_FIN  = 0x01;
   const static uint8_t kFlag_Data_UNI  = 0x02;
-  
+
   enum
   {
     CONTROL_TYPE_FIRST = 0,
     CONTROL_TYPE_SYN_STREAM = 1,
     CONTROL_TYPE_SYN_REPLY = 2,
     CONTROL_TYPE_RST_STREAM = 3,
     CONTROL_TYPE_SETTINGS = 4,
     CONTROL_TYPE_NOOP = 5,                        /* deprecated */
@@ -165,17 +165,17 @@ public:
   // an overload of nsAHttpConnection
   void TransactionHasDataToWrite(nsAHttpTransaction *);
 
   // a similar version for SpdyStream3
   void TransactionHasDataToWrite(SpdyStream3 *);
 
   // an overload of nsAHttpSegementReader
   virtual nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment);
-  
+
   uint32_t GetServerInitialWindow() { return mServerInitialWindow; }
 
   void     PrintDiagnostics (nsCString &log);
 
 private:
 
   enum stateType {
     BUFFERING_FRAME_HEADER,
@@ -210,17 +210,17 @@ private:
   bool        VerifyStream(SpdyStream3 *, uint32_t);
   void        SetNeedsCleanup();
 
   void        UpdateLocalRwin(SpdyStream3 *stream, uint32_t bytes);
 
   // a wrapper for all calls to the nshttpconnection level segment writer. Used
   // to track network I/O for timeout purposes
   nsresult   NetworkRead(nsAHttpSegmentWriter *, char *, uint32_t, uint32_t *);
-  
+
   static PLDHashOperator ShutdownEnumerator(nsAHttpTransaction *,
                                             nsAutoPtr<SpdyStream3> &,
                                             void *);
 
   static PLDHashOperator GoAwayEnumerator(nsAHttpTransaction *,
                                           nsAutoPtr<SpdyStream3> &,
                                           void *);
 
@@ -268,29 +268,29 @@ private:
   z_stream            mDownstreamZlib;
   z_stream            mUpstreamZlib;
 
   // mInputFrameBuffer is used to store received control packets and the 8 bytes
   // of header on data packets
   uint32_t             mInputFrameBufferSize;
   uint32_t             mInputFrameBufferUsed;
   nsAutoArrayPtr<char> mInputFrameBuffer;
-  
+
   // mInputFrameDataSize/Read are used for tracking the amount of data consumed
   // in a data frame. the data itself is not buffered in spdy
   // The frame size is mInputFrameDataSize + the constant 8 byte header
   uint32_t             mInputFrameDataSize;
   uint32_t             mInputFrameDataRead;
   bool                 mInputFrameDataLast; // This frame was marked FIN
 
   // When a frame has been received that is addressed to a particular stream
   // (e.g. a data frame after the stream-id has been decoded), this points
   // to the stream.
   SpdyStream3          *mInputFrameDataStream;
-  
+
   // mNeedsCleanup is a state variable to defer cleanup of a closed stream
   // If needed, It is set in session::OnWriteSegments() and acted on and
   // cleared when the stack returns to session::WriteSegments(). The stream
   // cannot be destroyed directly out of OnWriteSegments because
   // stream::writeSegments() is on the stack at that time.
   SpdyStream3          *mNeedsCleanup;
 
   // The CONTROL_TYPE value for a control frame
--- a/netwerk/protocol/http/SpdyStream2.cpp
+++ b/netwerk/protocol/http/SpdyStream2.cpp
@@ -75,17 +75,17 @@ nsresult
 SpdyStream2::ReadSegments(nsAHttpSegmentReader *reader,
                          uint32_t count,
                          uint32_t *countRead)
 {
   LOG3(("SpdyStream2 %p ReadSegments reader=%p count=%d state=%x",
         this, reader, count, mUpstreamState));
 
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   nsresult rv = NS_ERROR_UNEXPECTED;
   mRequestBlockedOnRead = 0;
 
   switch (mUpstreamState) {
   case GENERATING_SYN_STREAM:
   case GENERATING_REQUEST_BODY:
   case SENDING_REQUEST_BODY:
     // Call into the HTTP Transaction to generate the HTTP request
@@ -95,17 +95,17 @@ SpdyStream2::ReadSegments(nsAHttpSegment
     mSegmentReader = nullptr;
 
     // Check to see if the transaction's request could be written out now.
     // If not, mark the stream for callback when writing can proceed.
     if (NS_SUCCEEDED(rv) &&
         mUpstreamState == GENERATING_SYN_STREAM &&
         !mSynFrameComplete)
       mSession->TransactionHasDataToWrite(this);
-    
+
     // mTxinlineFrameUsed represents any queued un-sent frame. It might
     // be 0 if there is no such frame, which is not a gurantee that we
     // don't have more request body to send - just that any data that was
     // sent comprised a complete SPDY frame. Likewise, a non 0 value is
     // a queued, but complete, spdy frame length.
 
     // Mark that we are blocked on read if the http transaction needs to
     // provide more of the request message body and there is nothing queued
@@ -141,17 +141,17 @@ SpdyStream2::ReadSegments(nsAHttpSegment
       if (NS_SUCCEEDED(rv))
         ChangeState(UPSTREAM_COMPLETE);
     }
     else {
       rv = NS_OK;
       mTxInlineFrameUsed = 0;         // cancel fin data packet
       ChangeState(UPSTREAM_COMPLETE);
     }
-    
+
     *countRead = 0;
 
     // don't change OK to WOULD BLOCK. we are really done sending if OK
     break;
 
   case UPSTREAM_COMPLETE:
     *countRead = 0;
     rv = NS_OK;
@@ -172,17 +172,17 @@ SpdyStream2::ReadSegments(nsAHttpSegment
 
 nsresult
 SpdyStream2::WriteSegments(nsAHttpSegmentWriter *writer,
                           uint32_t count,
                           uint32_t *countWritten)
 {
   LOG3(("SpdyStream2::WriteSegments %p count=%d state=%x",
         this, count, mUpstreamState));
-  
+
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(!mSegmentWriter, "segment writer in progress");
 
   mSegmentWriter = writer;
   nsresult rv = mTransaction->WriteSegments(writer, count, countWritten);
   mSegmentWriter = nullptr;
   return rv;
 }
@@ -213,26 +213,26 @@ SpdyStream2::ParseHttpRequestHeaders(con
   LOG3(("SpdyStream2::ParseHttpRequestHeaders %p avail=%d state=%x",
         this, avail, mUpstreamState));
 
   mFlatHttpRequestHeaders.Append(buf, avail);
 
   // We can use the simple double crlf because firefox is the
   // only client we are parsing
   int32_t endHeader = mFlatHttpRequestHeaders.Find("\r\n\r\n");
-  
+
   if (endHeader == kNotFound) {
     // We don't have all the headers yet
     LOG3(("SpdyStream2::ParseHttpRequestHeaders %p "
           "Need more header bytes. Len = %d",
           this, mFlatHttpRequestHeaders.Length()));
     *countUsed = avail;
     return NS_OK;
   }
-           
+
   // We have recvd all the headers, trim the local
   // buffer of the final empty line, and set countUsed to reflect
   // the whole header has been consumed.
   uint32_t oldLen = mFlatHttpRequestHeaders.Length();
   mFlatHttpRequestHeaders.SetLength(endHeader + 2);
   *countUsed = avail - (oldLen - endHeader) + 4;
   mSynFrameComplete = 1;
 
@@ -259,20 +259,20 @@ SpdyStream2::ParseHttpRequestHeaders(con
   // Now we need to convert the flat http headers into a set
   // of SPDY headers..  writing to mTxInlineFrame{sz}
 
   mTxInlineFrame[0] = SpdySession2::kFlag_Control;
   mTxInlineFrame[1] = 2;                          /* version */
   mTxInlineFrame[2] = 0;
   mTxInlineFrame[3] = SpdySession2::CONTROL_TYPE_SYN_STREAM;
   // 4 to 7 are length and flags, we'll fill that in later
-  
+
   uint32_t networkOrderID = PR_htonl(mStreamID);
   memcpy(mTxInlineFrame + 8, &networkOrderID, 4);
-  
+
   // this is the associated-to field, which is not used sending
   // from the client in the http binding
   memset (mTxInlineFrame + 12, 0, 4);
 
   // Priority flags are the C0 mask of byte 16.
   //
   // The other 6 bits of 16 are unused. Spdy/3 will expand
   // priority to 3 bits.
@@ -286,91 +286,91 @@ SpdyStream2::ParseHttpRequestHeaders(con
   else if (mPriority >= nsISupportsPriority::PRIORITY_NORMAL)
     mTxInlineFrame[16] = SpdySession2::kPri02;
   else if (mPriority >= nsISupportsPriority::PRIORITY_HIGH)
     mTxInlineFrame[16] = SpdySession2::kPri01;
   else
     mTxInlineFrame[16] = SpdySession2::kPri00;
 
   mTxInlineFrame[17] = 0;                         /* unused */
-  
+
   const char *methodHeader = mTransaction->RequestHead()->Method().get();
 
   nsCString hostHeader;
   mTransaction->RequestHead()->GetHeader(nsHttp::Host, hostHeader);
 
   nsCString versionHeader;
   if (mTransaction->RequestHead()->Version() == NS_HTTP_VERSION_1_1)
     versionHeader = NS_LITERAL_CSTRING("HTTP/1.1");
   else
     versionHeader = NS_LITERAL_CSTRING("HTTP/1.0");
 
   nsClassHashtable<nsCStringHashKey, nsCString> hdrHash;
-  
+
   // use mRequestHead() to get a sense of how big to make the hash,
   // even though we are parsing the actual text stream because
   // it is legit to append headers.
   hdrHash.Init(1 + (mTransaction->RequestHead()->Headers().Count() * 2));
-  
+
   const char *beginBuffer = mFlatHttpRequestHeaders.BeginReading();
 
   // need to hash all the headers together to remove duplicates, special
   // headers, etc..
 
   int32_t crlfIndex = mFlatHttpRequestHeaders.Find("\r\n");
   while (true) {
     int32_t startIndex = crlfIndex + 2;
 
     crlfIndex = mFlatHttpRequestHeaders.Find("\r\n", false, startIndex);
     if (crlfIndex == -1)
       break;
-    
+
     int32_t colonIndex = mFlatHttpRequestHeaders.Find(":", false, startIndex,
                                                       crlfIndex - startIndex);
     if (colonIndex == -1)
       break;
-    
+
     nsDependentCSubstring name = Substring(beginBuffer + startIndex,
                                            beginBuffer + colonIndex);
     // all header names are lower case in spdy
     ToLowerCase(name);
 
     if (name.Equals("method") ||
         name.Equals("version") ||
         name.Equals("scheme") ||
         name.Equals("keep-alive") ||
         name.Equals("accept-encoding") ||
         name.Equals("te") ||
         name.Equals("connection") ||
         name.Equals("url"))
       continue;
-    
+
     nsCString *val = hdrHash.Get(name);
     if (!val) {
       val = new nsCString();
       hdrHash.Put(name, val);
     }
 
     int32_t valueIndex = colonIndex + 1;
     while (valueIndex < crlfIndex && beginBuffer[valueIndex] == ' ')
       ++valueIndex;
-    
+
     nsDependentCSubstring v = Substring(beginBuffer + valueIndex,
                                         beginBuffer + crlfIndex);
     if (!val->IsEmpty())
       val->Append(static_cast<char>(0));
     val->Append(v);
 
     if (name.Equals("content-length")) {
       int64_t len;
       if (nsHttp::ParseInt64(val->get(), nullptr, &len))
         mRequestBodyLenRemaining = len;
     }
   }
-  
+
   mTxInlineFrameUsed = 18;
 
   // Do not naively log the request headers here beacuse they might
   // contain auth. The http transaction already logs the sanitized request
   // headers at this same level so it is not necessary to do so here.
 
   // The header block length
   uint16_t count = hdrHash.Count() + 4; /* method, scheme, url, version */
@@ -381,27 +381,27 @@ SpdyStream2::ParseHttpRequestHeaders(con
   CompressToFrame(NS_LITERAL_CSTRING("method"));
   CompressToFrame(methodHeader, strlen(methodHeader));
   CompressToFrame(NS_LITERAL_CSTRING("scheme"));
   CompressToFrame(NS_LITERAL_CSTRING("https"));
   CompressToFrame(NS_LITERAL_CSTRING("url"));
   CompressToFrame(mTransaction->RequestHead()->RequestURI());
   CompressToFrame(NS_LITERAL_CSTRING("version"));
   CompressToFrame(versionHeader);
-  
+
   hdrHash.Enumerate(hdrHashEnumerate, this);
   CompressFlushFrame();
-  
+
   // 4 to 7 are length and flags, which we can now fill in
   (reinterpret_cast<uint32_t *>(mTxInlineFrame.get()))[1] =
     PR_htonl(mTxInlineFrameUsed - 8);
 
   MOZ_ASSERT(!mTxInlineFrame[4],
              "Size greater than 24 bits");
-  
+
   // Determine whether to put the fin bit on the syn stream frame or whether
   // to wait for a data packet to put it on.
 
   if (mTransaction->RequestHead()->Method() == nsHttp::Get ||
       mTransaction->RequestHead()->Method() == nsHttp::Connect ||
       mTransaction->RequestHead()->Method() == nsHttp::Head) {
     // for GET, CONNECT, and HEAD place the fin bit right on the
     // syn stream packet
@@ -416,25 +416,25 @@ SpdyStream2::ParseHttpRequestHeaders(con
     // the google gateway be unhappy with fin-on-syn for 0 length POST
   }
   else if (!mRequestBodyLenRemaining) {
     // for other HTTP extension methods, rely on the content-length
     // to determine whether or not to put fin on syn
     mSentFinOnData = 1;
     mTxInlineFrame[4] = SpdySession2::kFlag_Data_FIN;
   }
-  
+
   Telemetry::Accumulate(Telemetry::SPDY_SYN_SIZE, mTxInlineFrameUsed - 18);
 
   // The size of the input headers is approximate
   uint32_t ratio =
     (mTxInlineFrameUsed - 18) * 100 /
     (11 + mTransaction->RequestHead()->RequestURI().Length() +
      mFlatHttpRequestHeaders.Length());
-  
+
   Telemetry::Accumulate(Telemetry::SPDY_SYN_RATIO, ratio);
   return NS_OK;
 }
 
 void
 SpdyStream2::UpdateTransportReadEvents(uint32_t count)
 {
   mTotalRead += count;
@@ -494,17 +494,17 @@ SpdyStream2::TransmitFrame(const char *b
 
   MOZ_ASSERT(mTxInlineFrameUsed, "empty stream frame in transmit");
   MOZ_ASSERT(mSegmentReader, "TransmitFrame with null mSegmentReader");
   MOZ_ASSERT((buf && countUsed) || (!buf && !countUsed),
              "TransmitFrame arguments inconsistent");
 
   uint32_t transmittedCount;
   nsresult rv;
-  
+
   LOG3(("SpdyStream2::TransmitFrame %p inline=%d stream=%d",
         this, mTxInlineFrameUsed, mTxStreamFrameSize));
   if (countUsed)
     *countUsed = 0;
 
   // In the (relatively common) event that we have a small amount of data
   // split between the inlineframe and the streamframe, then move the stream
   // data into the inlineframe via copy in order to coalesce into one write.
@@ -531,32 +531,32 @@ SpdyStream2::TransmitFrame(const char *b
   }
   if (NS_FAILED(rv))     // this will include WOULD_BLOCK
     return rv;
 
   // This function calls mSegmentReader->OnReadSegment to report the actual SPDY
   // bytes through to the SpdySession2 and then the HttpConnection which calls
   // the socket write function. It will accept all of the inline and stream
   // data because of the above 'commitment' even if it has to buffer
-  
+
   rv = mSegmentReader->OnReadSegment(mTxInlineFrame, mTxInlineFrameUsed,
                                      &transmittedCount);
   LOG3(("SpdyStream2::TransmitFrame for inline session=%p "
         "stream=%p result %x len=%d",
         mSession, this, rv, transmittedCount));
 
   MOZ_ASSERT(rv != NS_BASE_STREAM_WOULD_BLOCK,
              "inconsistent inline commitment result");
 
   if (NS_FAILED(rv))
     return rv;
 
   MOZ_ASSERT(transmittedCount == mTxInlineFrameUsed,
              "inconsistent inline commitment count");
-    
+
   SpdySession2::LogIO(mSession, this, "Writing from Inline Buffer",
                      mTxInlineFrame, transmittedCount);
 
   if (mTxStreamFrameSize) {
     if (!buf) {
       // this cannot happen
       MOZ_ASSERT(false, "Stream transmit with null buf argument to "
                  "TransmitFrame()");
@@ -565,32 +565,32 @@ SpdyStream2::TransmitFrame(const char *b
     }
 
     rv = mSegmentReader->OnReadSegment(buf, mTxStreamFrameSize,
                                        &transmittedCount);
 
     LOG3(("SpdyStream2::TransmitFrame for regular session=%p "
           "stream=%p result %x len=%d",
           mSession, this, rv, transmittedCount));
-  
+
     MOZ_ASSERT(rv != NS_BASE_STREAM_WOULD_BLOCK,
                "inconsistent stream commitment result");
 
     if (NS_FAILED(rv))
       return rv;
 
     MOZ_ASSERT(transmittedCount == mTxStreamFrameSize,
                "inconsistent stream commitment count");
-    
+
     SpdySession2::LogIO(mSession, this, "Writing from Transaction Buffer",
                        buf, transmittedCount);
 
     *countUsed += mTxStreamFrameSize;
   }
-  
+
   // calling this will trigger waiting_for if mRequestBodyLenRemaining is 0
   UpdateTransportSendEvents(mTxInlineFrameUsed + mTxStreamFrameSize);
 
   mTxInlineFrameUsed = 0;
   mTxStreamFrameSize = 0;
 
   return NS_OK;
 }
@@ -609,24 +609,24 @@ SpdyStream2::GenerateDataFrameHeader(uin
 {
   LOG3(("SpdyStream2::GenerateDataFrameHeader %p len=%d last=%d",
         this, dataLength, lastFrame));
 
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(!mTxInlineFrameUsed, "inline frame not empty");
   MOZ_ASSERT(!mTxStreamFrameSize, "stream frame not empty");
   MOZ_ASSERT(!(dataLength & 0xff000000), "datalength > 24 bits");
-  
+
   (reinterpret_cast<uint32_t *>(mTxInlineFrame.get()))[0] = PR_htonl(mStreamID);
   (reinterpret_cast<uint32_t *>(mTxInlineFrame.get()))[1] =
     PR_htonl(dataLength);
-  
+
   MOZ_ASSERT(!(mTxInlineFrame[0] & 0x80), "control bit set unexpectedly");
   MOZ_ASSERT(!mTxInlineFrame[4], "flag bits set unexpectedly");
-  
+
   mTxInlineFrameUsed = 8;
   mTxStreamFrameSize = dataLength;
 
   if (lastFrame) {
     mTxInlineFrame[4] |= SpdySession2::kFlag_Data_FIN;
     if (dataLength)
       mSentFinOnData = 1;
   }
@@ -640,17 +640,17 @@ SpdyStream2::CompressToFrame(const nsACS
 
 void
 SpdyStream2::CompressToFrame(const nsACString *str)
 {
   CompressToFrame(str->BeginReading(), str->Length());
 }
 
 // Dictionary taken from
-// http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2 
+// http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2
 // Name/Value Header Block Format
 // spec indicates that the compression dictionary is not null terminated
 // but in reality it is. see:
 // https://groups.google.com/forum/#!topic/spdy-dev/2pWxxOZEIcs
 
 const char *SpdyStream2::kDictionary =
   "optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-"
   "languageauthorizationexpectfromhostif-modified-sinceif-matchif-none-matchi"
@@ -705,17 +705,17 @@ SpdyStream2::ExecuteCompress(uint32_t fl
   } while (mZlib->avail_in > 0 || !mZlib->avail_out);
 }
 
 void
 SpdyStream2::CompressToFrame(uint16_t data)
 {
   // convert the data to network byte order and write that
   // to the compressed stream
-  
+
   data = PR_htons(data);
 
   mZlib->next_in = reinterpret_cast<unsigned char *> (&data);
   mZlib->avail_in = 2;
   ExecuteCompress(Z_NO_FLUSH);
 }
 
 
@@ -726,22 +726,22 @@ SpdyStream2::CompressToFrame(const char 
   // followed by the utf8 string
 
   // for now, silently truncate headers greater than 64KB. Spdy/3 will
   // fix this by making the len a 32 bit quantity
   if (len > 0xffff)
     len = 0xffff;
 
   uint16_t networkLen = PR_htons(len);
-  
+
   // write out the length
   mZlib->next_in = reinterpret_cast<unsigned char *> (&networkLen);
   mZlib->avail_in = 2;
   ExecuteCompress(Z_NO_FLUSH);
-  
+
   // write out the data
   mZlib->next_in = (unsigned char *)data;
   mZlib->avail_in = len;
   ExecuteCompress(Z_NO_FLUSH);
 }
 
 void
 SpdyStream2::CompressFlushFrame()
@@ -766,17 +766,17 @@ SpdyStream2::OnReadSegment(const char *b
                           uint32_t count,
                           uint32_t *countRead)
 {
   LOG3(("SpdyStream2::OnReadSegment %p count=%d state=%x",
         this, count, mUpstreamState));
 
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(mSegmentReader);
-  
+
   nsresult rv = NS_ERROR_UNEXPECTED;
   uint32_t dataLength;
 
   switch (mUpstreamState) {
   case GENERATING_SYN_STREAM:
     // The buffer is the HTTP request stream, including at least part of the
     // HTTP request header. This state's job is to build a SYN_STREAM frame
     // from the header information. count is the number of http bytes available
@@ -835,22 +835,22 @@ SpdyStream2::OnReadSegment(const char *b
     // If that frame was all sent, look for another one
     if (!mTxInlineFrameUsed)
         ChangeState(GENERATING_REQUEST_BODY);
     break;
 
   case SENDING_FIN_STREAM:
     MOZ_ASSERT(false, "resuming partial fin stream out of OnReadSegment");
     break;
-    
+
   default:
     MOZ_ASSERT(false, "SpdyStream2::OnReadSegment non-write state");
     break;
   }
-  
+
   return rv;
 }
 
 //-----------------------------------------------------------------------------
 // nsAHttpSegmentWriter
 //-----------------------------------------------------------------------------
 
 nsresult
--- a/netwerk/protocol/http/SpdyStream2.h
+++ b/netwerk/protocol/http/SpdyStream2.h
@@ -30,17 +30,17 @@ public:
 
   bool RequestBlockedOnRead()
   {
     return static_cast<bool>(mRequestBlockedOnRead);
   }
 
   // returns false if called more than once
   bool GetFullyOpen() {return mFullyOpen;}
-  void SetFullyOpen() 
+  void SetFullyOpen()
   {
     MOZ_ASSERT(!mFullyOpen);
     mFullyOpen = 1;
   }
 
   bool HasRegisteredID() { return mStreamID != 0; }
 
   nsAHttpTransaction *Transaction()
@@ -88,17 +88,17 @@ private:
   void     GenerateDataFrameHeader(uint32_t, bool);
 
   void     CompressToFrame(const nsACString &);
   void     CompressToFrame(const nsACString *);
   void     CompressToFrame(const char *, uint32_t);
   void     CompressToFrame(uint16_t);
   void     CompressFlushFrame();
   void     ExecuteCompress(uint32_t);
-  
+
   // Each stream goes from syn_stream to upstream_complete, perhaps
   // looping on multiple instances of generating_request_body and
   // sending_request_body for each SPDY chunk in the upload.
   enum stateType mUpstreamState;
 
   // The underlying HTTP transaction. This pointer is used as the key
   // in the SpdySession2 mStreamTransactionHash so it is important to
   // keep a reference to it as long as this stream is a member of that hash.
--- a/netwerk/protocol/http/SpdyStream3.cpp
+++ b/netwerk/protocol/http/SpdyStream3.cpp
@@ -84,17 +84,17 @@ nsresult
 SpdyStream3::ReadSegments(nsAHttpSegmentReader *reader,
                          uint32_t count,
                          uint32_t *countRead)
 {
   LOG3(("SpdyStream3 %p ReadSegments reader=%p count=%d state=%x",
         this, reader, count, mUpstreamState));
 
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-  
+
   nsresult rv = NS_ERROR_UNEXPECTED;
   mRequestBlockedOnRead = 0;
 
   switch (mUpstreamState) {
   case GENERATING_SYN_STREAM:
   case GENERATING_REQUEST_BODY:
   case SENDING_REQUEST_BODY:
     // Call into the HTTP Transaction to generate the HTTP request
@@ -104,17 +104,17 @@ SpdyStream3::ReadSegments(nsAHttpSegment
     mSegmentReader = nullptr;
 
     // Check to see if the transaction's request could be written out now.
     // If not, mark the stream for callback when writing can proceed.
     if (NS_SUCCEEDED(rv) &&
         mUpstreamState == GENERATING_SYN_STREAM &&
         !mSynFrameComplete)
       mSession->TransactionHasDataToWrite(this);
-    
+
     // mTxinlineFrameUsed represents any queued un-sent frame. It might
     // be 0 if there is no such frame, which is not a gurantee that we
     // don't have more request body to send - just that any data that was
     // sent comprised a complete SPDY frame. Likewise, a non 0 value is
     // a queued, but complete, spdy frame length.
 
     // Mark that we are blocked on read if the http transaction needs to
     // provide more of the request message body and there is nothing queued
@@ -152,17 +152,17 @@ SpdyStream3::ReadSegments(nsAHttpSegment
       if (NS_SUCCEEDED(rv))
         ChangeState(UPSTREAM_COMPLETE);
     }
     else {
       rv = NS_OK;
       mTxInlineFrameUsed = 0;         // cancel fin data packet
       ChangeState(UPSTREAM_COMPLETE);
     }
-    
+
     *countRead = 0;
 
     // don't change OK to WOULD BLOCK. we are really done sending if OK
     break;
 
   case UPSTREAM_COMPLETE:
     *countRead = 0;
     rv = NS_OK;
@@ -183,17 +183,17 @@ SpdyStream3::ReadSegments(nsAHttpSegment
 
 nsresult
 SpdyStream3::WriteSegments(nsAHttpSegmentWriter *writer,
                           uint32_t count,
                           uint32_t *countWritten)
 {
   LOG3(("SpdyStream3::WriteSegments %p count=%d state=%x",
         this, count, mUpstreamState));
-  
+
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(!mSegmentWriter, "segment writer in progress");
 
   mSegmentWriter = writer;
   nsresult rv = mTransaction->WriteSegments(writer, count, countWritten);
   mSegmentWriter = nullptr;
   return rv;
 }
@@ -224,26 +224,26 @@ SpdyStream3::ParseHttpRequestHeaders(con
   LOG3(("SpdyStream3::ParseHttpRequestHeaders %p avail=%d state=%x",
         this, avail, mUpstreamState));
 
   mFlatHttpRequestHeaders.Append(buf, avail);
 
   // We can use the simple double crlf because firefox is the
   // only client we are parsing
   int32_t endHeader = mFlatHttpRequestHeaders.Find("\r\n\r\n");
-  
+
   if (endHeader == kNotFound) {
     // We don't have all the headers yet
     LOG3(("SpdyStream3::ParseHttpRequestHeaders %p "
           "Need more header bytes. Len = %d",
           this, mFlatHttpRequestHeaders.Length()));
     *countUsed = avail;
     return NS_OK;
   }
-           
+
   // We have recvd all the headers, trim the local
   // buffer of the final empty line, and set countUsed to reflect
   // the whole header has been consumed.
   uint32_t oldLen = mFlatHttpRequestHeaders.Length();
   mFlatHttpRequestHeaders.SetLength(endHeader + 2);
   *countUsed = avail - (oldLen - endHeader) + 4;
   mSynFrameComplete = 1;
 
@@ -269,87 +269,87 @@ SpdyStream3::ParseHttpRequestHeaders(con
   // Now we need to convert the flat http headers into a set
   // of SPDY headers..  writing to mTxInlineFrame{sz}
 
   mTxInlineFrame[0] = SpdySession3::kFlag_Control;
   mTxInlineFrame[1] = SpdySession3::kVersion;
   mTxInlineFrame[2] = 0;
   mTxInlineFrame[3] = SpdySession3::CONTROL_TYPE_SYN_STREAM;
   // 4 to 7 are length and flags, we'll fill that in later
-  
+
   uint32_t networkOrderID = PR_htonl(mStreamID);
   memcpy(mTxInlineFrame + 8, &networkOrderID, 4);
-  
+
   // this is the associated-to field, which is not used sending
   // from the client in the http binding
   memset (mTxInlineFrame + 12, 0, 4);
 
   // Priority flags are the E0 mask of byte 16.
   // 0 is highest priority, 7 is lowest.
   // The other 5 bits of byte 16 are unused.
-  
+
   if (mPriority >= nsISupportsPriority::PRIORITY_LOWEST)
     mTxInlineFrame[16] = 7 << 5;
   else if (mPriority <= nsISupportsPriority::PRIORITY_HIGHEST)
     mTxInlineFrame[16] = 0 << 5;
   else {
     // The priority mapping relies on the unfiltered ranged to be
     // between -20 .. +20
     PR_STATIC_ASSERT(nsISupportsPriority::PRIORITY_LOWEST == 20);
     PR_STATIC_ASSERT(nsISupportsPriority::PRIORITY_HIGHEST == -20);
 
     // Add one to the priority so that values such as -10 and -11
     // get different spdy priorities - this appears to be an important
     // breaking line in the priorities content assigns to
-    // transactions. 
+    // transactions.
     uint8_t calculatedPriority = 3 + ((mPriority + 1) / 5);
     MOZ_ASSERT (!(calculatedPriority & 0xf8),
                 "Calculated Priority Out Of Range");
     mTxInlineFrame[16] = calculatedPriority << 5;
   }
 
   // The client cert "slot". Right now we don't send client certs
   mTxInlineFrame[17] = 0;
-  
+
   const char *methodHeader = mTransaction->RequestHead()->Method().get();
 
   nsCString hostHeader;
   mTransaction->RequestHead()->GetHeader(nsHttp::Host, hostHeader);
 
   nsCString versionHeader;
   if (mTransaction->RequestHead()->Version() == NS_HTTP_VERSION_1_1)
     versionHeader = NS_LITERAL_CSTRING("HTTP/1.1");
   else
     versionHeader = NS_LITERAL_CSTRING("HTTP/1.0");
 
   nsClassHashtable<nsCStringHashKey, nsCString> hdrHash;
-  
+
   // use mRequestHead() to get a sense of how big to make the hash,
   // even though we are parsing the actual text stream because
   // it is legit to append headers.
   hdrHash.Init(1 + (mTransaction->RequestHead()->Headers().Count() * 2));
-  
+
   const char *beginBuffer = mFlatHttpRequestHeaders.BeginReading();
 
   // need to hash all the headers together to remove duplicates, special
   // headers, etc..
 
   int32_t crlfIndex = mFlatHttpRequestHeaders.Find("\r\n");
   while (true) {
     int32_t startIndex = crlfIndex + 2;
 
     crlfIndex = mFlatHttpRequestHeaders.Find("\r\n", false, startIndex);
     if (crlfIndex == -1)
       break;
-    
+
     int32_t colonIndex = mFlatHttpRequestHeaders.Find(":", false, startIndex,
                                                       crlfIndex - startIndex);
     if (colonIndex == -1)
       break;
-    
+
     nsDependentCSubstring name = Substring(beginBuffer + startIndex,
                                            beginBuffer + colonIndex);
     // all header names are lower case in spdy
     ToLowerCase(name);
 
     // exclusions.. mostly from 3.2.1
     if (name.Equals("connection") ||
         name.Equals("keep-alive") ||
@@ -363,30 +363,30 @@ SpdyStream3::ParseHttpRequestHeaders(con
     if (!val) {
       val = new nsCString();
       hdrHash.Put(name, val);
     }
 
     int32_t valueIndex = colonIndex + 1;
     while (valueIndex < crlfIndex && beginBuffer[valueIndex] == ' ')
       ++valueIndex;
-    
+
     nsDependentCSubstring v = Substring(beginBuffer + valueIndex,
                                         beginBuffer + crlfIndex);
     if (!val->IsEmpty())
       val->Append(static_cast<char>(0));
     val->Append(v);
 
     if (name.Equals("content-length")) {
       int64_t len;
       if (nsHttp::ParseInt64(val->get(), nullptr, &len))
         mRequestBodyLenRemaining = len;
     }
   }
-  
+
   mTxInlineFrameUsed = 18;
 
   // Do not naively log the request headers here beacuse they might
   // contain auth. The http transaction already logs the sanitized request
   // headers at this same level so it is not necessary to do so here.
 
   // The header block length
   uint16_t count = hdrHash.Count() + 5; /* method, path, version, host, scheme */
@@ -403,23 +403,23 @@ SpdyStream3::ParseHttpRequestHeaders(con
 
   CompressToFrame(NS_LITERAL_CSTRING(":host"));
   CompressToFrame(hostHeader);
   CompressToFrame(NS_LITERAL_CSTRING(":scheme"));
   CompressToFrame(NS_LITERAL_CSTRING("https"));
 
   hdrHash.Enumerate(hdrHashEnumerate, this);
   CompressFlushFrame();
-  
+
   // 4 to 7 are length and flags, which we can now fill in
   (reinterpret_cast<uint32_t *>(mTxInlineFrame.get()))[1] =
     PR_htonl(mTxInlineFrameUsed - 8);
 
   MOZ_ASSERT(!mTxInlineFrame[4], "Size greater than 24 bits");
-  
+
   // Determine whether to put the fin bit on the syn stream frame or whether
   // to wait for a data packet to put it on.
 
   if (mTransaction->RequestHead()->Method() == nsHttp::Get ||
       mTransaction->RequestHead()->Method() == nsHttp::Connect ||
       mTransaction->RequestHead()->Method() == nsHttp::Head) {
     // for GET, CONNECT, and HEAD place the fin bit right on the
     // syn stream packet
@@ -434,25 +434,25 @@ SpdyStream3::ParseHttpRequestHeaders(con
     // the google gateway be unhappy with fin-on-syn for 0 length POST
   }
   else if (!mRequestBodyLenRemaining) {
     // for other HTTP extension methods, rely on the content-length
     // to determine whether or not to put fin on syn
     mSentFinOnData = 1;
     mTxInlineFrame[4] = SpdySession3::kFlag_Data_FIN;
   }
-  
+
   Telemetry::Accumulate(Telemetry::SPDY_SYN_SIZE, mTxInlineFrameUsed - 18);
 
   // The size of the input headers is approximate
   uint32_t ratio =
     (mTxInlineFrameUsed - 18) * 100 /
     (11 + mTransaction->RequestHead()->RequestURI().Length() +
      mFlatHttpRequestHeaders.Length());
-  
+
   Telemetry::Accumulate(Telemetry::SPDY_SYN_RATIO, ratio);
   return NS_OK;
 }
 
 void
 SpdyStream3::UpdateTransportReadEvents(uint32_t count)
 {
   mTotalRead += count;
@@ -512,17 +512,17 @@ SpdyStream3::TransmitFrame(const char *b
 
   MOZ_ASSERT(mTxInlineFrameUsed, "empty stream frame in transmit");
   MOZ_ASSERT(mSegmentReader, "TransmitFrame with null mSegmentReader");
   MOZ_ASSERT((buf && countUsed) || (!buf && !countUsed),
              "TransmitFrame arguments inconsistent");
 
   uint32_t transmittedCount;
   nsresult rv;
-  
+
   LOG3(("SpdyStream3::TransmitFrame %p inline=%d stream=%d",
         this, mTxInlineFrameUsed, mTxStreamFrameSize));
   if (countUsed)
     *countUsed = 0;
 
   // In the (relatively common) event that we have a small amount of data
   // split between the inlineframe and the streamframe, then move the stream
   // data into the inlineframe via copy in order to coalesce into one write.
@@ -585,32 +585,32 @@ SpdyStream3::TransmitFrame(const char *b
     }
 
     rv = mSegmentReader->OnReadSegment(buf, mTxStreamFrameSize,
                                        &transmittedCount);
 
     LOG3(("SpdyStream3::TransmitFrame for regular session=%p "
           "stream=%p result %x len=%d",
           mSession, this, rv, transmittedCount));
-  
+
     MOZ_ASSERT(rv != NS_BASE_STREAM_WOULD_BLOCK,
                "inconsistent stream commitment result");
 
     if (NS_FAILED(rv))
       return rv;
 
     MOZ_ASSERT(transmittedCount == mTxStreamFrameSize,
                "inconsistent stream commitment count");
-    
+
     SpdySession3::LogIO(mSession, this, "Writing from Transaction Buffer",
                        buf, transmittedCount);
 
     *countUsed += mTxStreamFrameSize;
   }
-  
+
   // calling this will trigger waiting_for if mRequestBodyLenRemaining is 0
   UpdateTransportSendEvents(mTxInlineFrameUsed + mTxStreamFrameSize);
 
   mTxInlineFrameUsed = 0;
   mTxStreamFrameSize = 0;
 
   return NS_OK;
 }
@@ -629,24 +629,24 @@ SpdyStream3::GenerateDataFrameHeader(uin
 {
   LOG3(("SpdyStream3::GenerateDataFrameHeader %p len=%d last=%d",
         this, dataLength, lastFrame));
 
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(!mTxInlineFrameUsed, "inline frame not empty");
   MOZ_ASSERT(!mTxStreamFrameSize, "stream frame not empty");
   MOZ_ASSERT(!(dataLength & 0xff000000), "datalength > 24 bits");
-  
+
   (reinterpret_cast<uint32_t *>(mTxInlineFrame.get()))[0] = PR_htonl(mStreamID);
   (reinterpret_cast<uint32_t *>(mTxInlineFrame.get()))[1] =
     PR_htonl(dataLength);
-  
+
   MOZ_ASSERT(!(mTxInlineFrame[0] & 0x80), "control bit set unexpectedly");
   MOZ_ASSERT(!mTxInlineFrame[4], "flag bits set unexpectedly");
-  
+
   mTxInlineFrameUsed = 8;
   mTxStreamFrameSize = dataLength;
 
   if (lastFrame) {
     mTxInlineFrame[4] |= SpdySession3::kFlag_Data_FIN;
     if (dataLength)
       mSentFinOnData = 1;
   }
@@ -880,30 +880,30 @@ SpdyStream3::Uncompress(z_stream *contex
     context->avail_out = mDecompressBufferSize - mDecompressBufferUsed;
     int zlib_rv = inflate(context, Z_NO_FLUSH);
 
     if (zlib_rv == Z_NEED_DICT) {
       if (triedDictionary) {
         LOG3(("SpdySession3::Uncompress %p Dictionary Error\n", this));
         return NS_ERROR_FAILURE;
       }
-      
-      triedDictionary = true;      
+
+      triedDictionary = true;
       inflateSetDictionary(context, kDictionary, sizeof(kDictionary));
     }
-    
+
     if (zlib_rv == Z_DATA_ERROR || zlib_rv == Z_MEM_ERROR)
       return NS_ERROR_FAILURE;
 
     // zlib's inflate() decreases context->avail_out by the amount it places
     // in the output buffer
 
     mDecompressBufferUsed += mDecompressBufferSize - mDecompressBufferUsed -
       context->avail_out;
-    
+
     // When there is no more output room, but input still available then
     // increase the output space
     if (zlib_rv == Z_OK &&
         !context->avail_out && context->avail_in) {
       LOG3(("SpdyStream3::Uncompress %p Large Headers - so far %d",
             this, mDecompressBufferSize));
       SpdySession3::EnsureBuffer(mDecompressBuffer,
                                  mDecompressBufferSize + 4096,
@@ -980,17 +980,17 @@ SpdyStream3::ConvertHeaders(nsACString &
   aHeadersOut.Truncate();
   aHeadersOut.SetCapacity(mDecompressBufferUsed + 64);
 
   // Connection, Keep-Alive and chunked transfer encodings are to be
   // removed.
 
   // Content-Length is 'advisory'.. we will not strip it because it can
   // create UI feedback.
-  
+
   aHeadersOut.Append(version);
   aHeadersOut.Append(NS_LITERAL_CSTRING(" "));
   aHeadersOut.Append(status);
   aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n"));
 
   const unsigned char *nvpair = reinterpret_cast<unsigned char *>
     (mDecompressBuffer.get()) + 4;
   const unsigned char *lastHeaderByte = reinterpret_cast<unsigned char *>
@@ -1142,22 +1142,22 @@ SpdyStream3::CompressToFrame(uint32_t da
 
 void
 SpdyStream3::CompressToFrame(const char *data, uint32_t len)
 {
   // Format calls for a network ordered 32 bit length
   // followed by the utf8 string
 
   uint32_t networkLen = PR_htonl(len);
-  
+
   // write out the length
   mZlib->next_in = reinterpret_cast<unsigned char *> (&networkLen);
   mZlib->avail_in = 4;
   ExecuteCompress(Z_NO_FLUSH);
-  
+
   // write out the data
   mZlib->next_in = (unsigned char *)data;
   mZlib->avail_in = len;
   ExecuteCompress(Z_NO_FLUSH);
 }
 
 void
 SpdyStream3::CompressFlushFrame()
@@ -1182,17 +1182,17 @@ SpdyStream3::OnReadSegment(const char *b
                           uint32_t count,
                           uint32_t *countRead)
 {
   LOG3(("SpdyStream3::OnReadSegment %p count=%d state=%x",
         this, count, mUpstreamState));
 
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
   MOZ_ASSERT(mSegmentReader, "OnReadSegment with null mSegmentReader");
-  
+
   nsresult rv = NS_ERROR_UNEXPECTED;
   uint32_t dataLength;
 
   switch (mUpstreamState) {
   case GENERATING_SYN_STREAM:
     // The buffer is the HTTP request stream, including at least part of the
     // HTTP request header. This state's job is to build a SYN_STREAM frame
     // from the header information. count is the number of http bytes available
@@ -1230,17 +1230,17 @@ SpdyStream3::OnReadSegment(const char *b
     }
     mBlockedOnRwin = false;
 
     dataLength = std::min(count, mChunkSize);
 
     if (dataLength > mRemoteWindow)
       dataLength = static_cast<uint32_t>(mRemoteWindow);
 
-    LOG3(("SpdyStream3 this=%p id 0x%X remote window is %d. Chunk is %d\n", 
+    LOG3(("SpdyStream3 this=%p id 0x%X remote window is %d. Chunk is %d\n",
           this, mStreamID, mRemoteWindow, dataLength));
     mRemoteWindow -= dataLength;
 
     LOG3(("SpdyStream3 %p id %x request len remaining %d, "
           "count avail %d, chunk used %d",
           this, mStreamID, mRequestBodyLenRemaining, count, dataLength));
     if (dataLength > mRequestBodyLenRemaining)
       return NS_ERROR_UNEXPECTED;
@@ -1268,22 +1268,22 @@ SpdyStream3::OnReadSegment(const char *b
     // If that frame was all sent, look for another one
     if (!mTxInlineFrameUsed)
         ChangeState(GENERATING_REQUEST_BODY);
     break;
 
   case SENDING_FIN_STREAM:
     MOZ_ASSERT(false, "resuming partial fin stream out of OnReadSegment");
     break;
-    
+
   default:
     MOZ_ASSERT(false, "SpdyStream3::OnReadSegment non-write state");
     break;
   }
-  
+
   return rv;
 }
 
 //-----------------------------------------------------------------------------
 // nsAHttpSegmentWriter
 //-----------------------------------------------------------------------------
 
 nsresult
--- a/netwerk/protocol/http/SpdyStream3.h
+++ b/netwerk/protocol/http/SpdyStream3.h
@@ -29,17 +29,17 @@ public:
 
   bool RequestBlockedOnRead()
   {
     return static_cast<bool>(mRequestBlockedOnRead);
   }
 
   // returns false if called more than once
   bool GetFullyOpen() {return mFullyOpen;}
-  void SetFullyOpen() 
+  void SetFullyOpen()
   {
     MOZ_ASSERT(!mFullyOpen);
     mFullyOpen = 1;
   }
 
   bool HasRegisteredID() { return mStreamID != 0; }
 
   nsAHttpTransaction *Transaction()
@@ -110,17 +110,17 @@ private:
 
   void     CompressToFrame(const nsACString &);
   void     CompressToFrame(const nsACString *);
   void     CompressToFrame(const char *, uint32_t);
   void     CompressToFrame(uint32_t);
   void     CompressFlushFrame();
   void     ExecuteCompress(uint32_t);
   nsresult FindHeader(nsCString, nsDependentCSubstring &);
-  
+
   // Each stream goes from syn_stream to upstream_complete, perhaps
   // looping on multiple instances of generating_request_body and
   // sending_request_body for each SPDY chunk in the upload.
   enum stateType mUpstreamState;
 
   // The underlying HTTP transaction. This pointer is used as the key
   // in the SpdySession3 mStreamTransactionHash so it is important to
   // keep a reference to it as long as this stream is a member of that hash.
--- a/netwerk/protocol/http/nsAHttpTransaction.h
+++ b/netwerk/protocol/http/nsAHttpTransaction.h
@@ -59,17 +59,17 @@ public:
     virtual nsresult WriteSegments(nsAHttpSegmentWriter *writer,
                                    uint32_t count, uint32_t *countWritten) = 0;
 
     // called to close the transaction
     virtual void Close(nsresult reason) = 0;
 
     // called to indicate a failure with proxy CONNECT
     virtual void SetProxyConnectFailed() = 0;
-    
+
     // called to retrieve the request headers of the transaction
     virtual nsHttpRequestHead *RequestHead() = 0;
 
     // determine the number of real http/1.x transactions on this
     // abstract object. Pipelines may have multiple, SPDY has 0,
     // normal http transactions have 1.
     virtual uint32_t Http1xTransactionCount() = 0;
 
@@ -84,17 +84,17 @@ public:
     //
     virtual nsresult TakeSubTransactions(
         nsTArray<nsRefPtr<nsAHttpTransaction> > &outTransactions) = 0;
 
     // called to add a sub-transaction in the case of pipelined transactions
     // classes that do not implement sub transactions
     // return NS_ERROR_NOT_IMPLEMENTED
     virtual nsresult AddTransaction(nsAHttpTransaction *transaction) = 0;
-    
+
     // The total length of the outstanding pipeline comprised of transacations
     // and sub-transactions.
     virtual uint32_t PipelineDepth() = 0;
 
     // Used to inform the connection that it is being used in a pipelined
     // context. That may influence the handling of some errors.
     // The value is the pipeline position (> 1).
     virtual nsresult SetPipelinePosition(int32_t) = 0;
@@ -104,31 +104,31 @@ public:
     // dynamic_cast<nsHttpPipeline *>(this).. i.e. it can be nullptr for
     // non pipeline implementations of nsAHttpTransaction
     virtual nsHttpPipeline *QueryPipeline() { return nullptr; }
 
     // equivalent to !!dynamic_cast<NullHttpTransaction *>(this)
     // A null transaction is expected to return BASE_STREAM_CLOSED on all of
     // its IO functions all the time.
     virtual bool IsNullTransaction() { return false; }
-    
+
     // Every transaction is classified into one of the types below. When using
     // HTTP pipelines, only transactions with the same type appear on the same
     // pipeline.
     enum Classifier  {
         // Transactions that expect a short 304 (no-content) response
         CLASS_REVALIDATION,
 
         // Transactions for content expected to be CSS or JS
         CLASS_SCRIPT,
 
         // Transactions for content expected to be an image
         CLASS_IMAGE,
 
-        // Transactions that cannot involve a pipeline 
+        // Transactions that cannot involve a pipeline
         CLASS_SOLO,
 
         // Transactions that do not fit any of the other categories. HTML
         // is normally GENERAL.
         CLASS_GENERAL,
 
         CLASS_MAX
     };
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -121,17 +121,17 @@ nsHttp::CreateAtomTable()
         nullptr
     };
 
     for (int i = 0; atoms[i]; ++i) {
         PLDHashEntryStub *stub = reinterpret_cast<PLDHashEntryStub *>
                                                  (PL_DHashTableOperate(&sAtomTable, atoms[i], PL_DHASH_ADD));
         if (!stub)
             return NS_ERROR_OUT_OF_MEMORY;
-        
+
         MOZ_ASSERT(!stub->key, "duplicate static atom");
         stub->key = atoms[i];
     }
 
     return NS_OK;
 }
 
 void
--- a/netwerk/protocol/http/nsHttpAtomList.h
+++ b/netwerk/protocol/http/nsHttpAtomList.h
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /******
-  This file contains the list of all HTTP atoms 
+  This file contains the list of all HTTP atoms
   See nsHttp.h for access to the atoms.
 
   It is designed to be used as inline input to nsHttp.cpp *only*
   through the magic of C preprocessing.
 
   All entries must be enclosed in the macro HTTP_ATOM which will have cruel
   and unusual things done to it.
 
--- a/netwerk/protocol/http/nsHttpAuthCache.cpp
+++ b/netwerk/protocol/http/nsHttpAuthCache.cpp
@@ -326,17 +326,17 @@ nsresult
 nsHttpAuthIdentity::Set(const PRUnichar *domain,
                         const PRUnichar *user,
                         const PRUnichar *pass)
 {
     PRUnichar *newUser, *newPass, *newDomain;
 
     int domainLen = domain ? NS_strlen(domain) : 0;
     int userLen   = user   ? NS_strlen(user)   : 0;
-    int passLen   = pass   ? NS_strlen(pass)   : 0; 
+    int passLen   = pass   ? NS_strlen(pass)   : 0;
 
     int len = userLen + 1 + passLen + 1 + domainLen + 1;
     newUser = (PRUnichar *) malloc(len * sizeof(PRUnichar));
     if (!newUser)
         return NS_ERROR_OUT_OF_MEMORY;
 
     if (user)
         memcpy(newUser, user, userLen * sizeof(PRUnichar));
@@ -409,17 +409,17 @@ nsHttpAuthEntry::AddPath(const char *aPa
     while (tempPtr) {
         const char *curpath = tempPtr->mPath;
         if (strncmp(aPath, curpath, strlen(curpath)) == 0)
             return NS_OK; // subpath already exists in the list
 
         tempPtr = tempPtr->mNext;
 
     }
-    
+
     //Append the aPath
     nsHttpAuthPath *newAuthPath;
     int newpathLen = strlen(aPath);
     newAuthPath = (nsHttpAuthPath *) malloc(sizeof(nsHttpAuthPath) + newpathLen);
     if (!newAuthPath)
         return NS_ERROR_OUT_OF_MEMORY;
 
     memcpy(newAuthPath->mPath, aPath, newpathLen+1);
@@ -466,17 +466,17 @@ nsHttpAuthEntry::Set(const char *path,
     newChall = &newCreds[credsLen + 1];
     if (chall)
         memcpy(newChall, chall, challLen);
     newChall[challLen] = 0;
 
     nsresult rv = NS_OK;
     if (ident) {
         rv = mIdent.Set(*ident);
-    } 
+    }
     else if (mIdent.IsEmpty()) {
         // If we are not given an identity and our cached identity has not been
         // initialized yet (so is currently empty), initialize it now by
         // filling it with nulls.  We need to do that because consumers expect
         // that mIdent is initialized after this function returns.
         rv = mIdent.Set(nullptr, nullptr, nullptr);
     }
     if (NS_FAILED(rv)) {
--- a/netwerk/protocol/http/nsHttpAuthCache.h
+++ b/netwerk/protocol/http/nsHttpAuthCache.h
@@ -12,18 +12,16 @@
 #include "nsAutoPtr.h"
 #include "nsAString.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "plhash.h"
 #include "nsCRT.h"
 #include "nsIObserver.h"
 
-
-
 struct nsHttpAuthPath {
     struct nsHttpAuthPath *mNext;
     char                   mPath[1];
 };
 
 //-----------------------------------------------------------------------------
 // nsHttpAuthIdentity
 //-----------------------------------------------------------------------------
@@ -80,19 +78,19 @@ public:
     const char *Creds()       const { return mCreds; }
     const char *Challenge()   const { return mChallenge; }
     const PRUnichar *Domain() const { return mIdent.Domain(); }
     const PRUnichar *User()   const { return mIdent.User(); }
     const PRUnichar *Pass()   const { return mIdent.Password(); }
     nsHttpAuthPath *RootPath()      { return mRoot; }
 
     const nsHttpAuthIdentity &Identity() const { return mIdent; }
-            
+
     nsresult AddPath(const char *aPath);
-            
+
     nsCOMPtr<nsISupports> mMetaData;
 
 private:
     nsHttpAuthEntry(const char *path,
                     const char *realm,
                     const char *creds,
                     const char *challenge,
                     const nsHttpAuthIdentity *ident,
@@ -216,17 +214,17 @@ public:
 
     void ClearAuthEntry(const char *scheme,
                         const char *host,
                         int32_t     port,
                         const char *realm,
                         uint32_t    appId,
                         bool        inBrowserElement);
 
-    // expire all existing auth list entries including proxy auths. 
+    // expire all existing auth list entries including proxy auths.
     nsresult ClearAll();
 
 private:
     nsHttpAuthNode *LookupAuthNode(const char *scheme,
                                    const char *host,
                                    int32_t     port,
                                    uint32_t    appId,
                                    bool        inBrowserElement,
@@ -245,15 +243,15 @@ private:
       NS_DECL_ISUPPORTS
       NS_DECL_NSIOBSERVER
       AppDataClearObserver(nsHttpAuthCache* aOwner) : mOwner(aOwner) {}
       virtual ~AppDataClearObserver() {}
       nsHttpAuthCache* mOwner;
     };
 
     void ClearAppData(uint32_t appId, bool browserOnly);
-    
+
 private:
     PLHashTable *mDB; // "host:port" --> nsHttpAuthNode
     nsRefPtr<AppDataClearObserver> mObserver;
 };
 
 #endif // nsHttpAuthCache_h__
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -33,17 +33,17 @@
 #include "GeckoProfiler.h"
 #include "nsIConsoleService.h"
 #include "base/compiler_specific.h"
 #include "NullHttpTransaction.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/VisualEventTracer.h"
 
 namespace mozilla { namespace net {
- 
+
 namespace {
 
 // Device IDs for various cache types
 const char kDiskDeviceID[] = "disk";
 const char kMemoryDeviceID[] = "memory";
 const char kOfflineDeviceID[] = "offline";
 
 // True if the local cache should be bypassed when processing a request.
@@ -79,17 +79,17 @@ AccumulateCacheHitTelemetry(Telemetry::I
 }
 
 // Computes and returns a SHA1 hash of the input buffer. The input buffer
 // must be a null-terminated string.
 nsresult
 Hash(const char *buf, nsACString &hash)
 {
     nsresult rv;
-      
+
     nsCOMPtr<nsICryptoHash> hasher
       = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = hasher->Init(nsICryptoHash::SHA1);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = hasher->Update(reinterpret_cast<unsigned const char*>(buf),
@@ -127,17 +127,17 @@ MaybeMarkCacheEntryValid(const void * ch
     // XXX: Is it really necessary to check for write acccess to the entry?
     if (cacheAccess & nsICache::ACCESS_WRITE) {
         nsresult rv = cacheEntry->MarkValid();
         LOG(("Marking cache entry valid "
              "[channel=%p, entry=%p, access=%d, result=%d]",
              channel, cacheEntry, int(cacheAccess), int(rv)));
     } else {
         LOG(("Not marking read-only cache entry valid "
-             "[channel=%p, entry=%p, access=%d]", 
+             "[channel=%p, entry=%p, access=%d]",
              channel, cacheEntry, int(cacheAccess)));
     }
 }
 
 } // unnamed namespace
 
 class AutoRedirectVetoNotifier
 {
@@ -155,18 +155,18 @@ void
 AutoRedirectVetoNotifier::ReportRedirectResult(bool succeeded)
 {
     if (!mChannel)
         return;
 
     mChannel->mRedirectChannel = nullptr;
 
     nsCOMPtr<nsIRedirectResultListener> vetoHook;
-    NS_QueryNotificationCallbacks(mChannel, 
-                                  NS_GET_IID(nsIRedirectResultListener), 
+    NS_QueryNotificationCallbacks(mChannel,
+                                  NS_GET_IID(nsIRedirectResultListener),
                                   getter_AddRefs(vetoHook));
 
 #ifdef MOZ_VISUAL_EVENT_TRACER
     nsHttpChannel* channel = mChannel;
 #endif
     mChannel = nullptr;
     if (vetoHook)
         vetoHook->OnRedirectResult(succeeded);
@@ -252,17 +252,17 @@ private:
     const nsCacheStoragePolicy mStoragePolicy;
     const bool mUsingPrivateBrowsing;
     const InfallableCopyCString mCacheKey;
     const nsCacheAccessMode mAccessToRequest;
     const bool mNoWait;
     const bool mUsingSSL;
     const bool mLoadedFromApplicationCache;
 
-    // Used only internally 
+    // Used only internally
     nsCOMPtr<nsIEventTarget> mCacheThread;
     nsCOMPtr<nsICacheEntryDescriptor> mCacheEntry;
     nsCacheAccessMode mCacheAccess;
     nsresult mStatus;
     uint32_t mRunCount;
 
     // Copied from HttpcacheQuery into nsHttpChannel by nsHttpChannel
     friend class nsHttpChannel;
@@ -464,17 +464,17 @@ nsHttpChannel::ContinueConnect()
             }
 
             AccumulateCacheHitTelemetry(mCacheEntryDeviceTelemetryID,
                                         kCacheHit);
 
             return rv;
         }
         else if (mLoadFlags & LOAD_ONLY_FROM_CACHE) {
-            // the cache contains the requested resource, but it must be 
+            // the cache contains the requested resource, but it must be
             // validated before we can reuse it.  since we are not allowed
             // to hit the net, there's nothing more to do.  the document
             // is effectively not in the cache.
             return NS_ERROR_DOCUMENT_NOT_CACHED;
         }
     }
     else if (mLoadFlags & LOAD_ONLY_FROM_CACHE) {
         // If we have a fallback URI (and we're not already
@@ -511,27 +511,27 @@ nsHttpChannel::SpeculativeConnect()
 {
     // Before we take the latency hit of dealing with the cache, try and
     // get the TCP (and SSL) handshakes going so they can overlap.
 
     // don't speculate on uses of the offline application cache,
     // if we are offline, when doing http upgrade (i.e. websockets bootstrap),
     // or if we can't do keep-alive (because then we couldn't reuse
     // the speculative connection anyhow).
-    if (mApplicationCache || gIOService->IsOffline() || 
+    if (mApplicationCache || gIOService->IsOffline() ||
         mUpgradeProtocolCallback || !(mCaps & NS_HTTP_ALLOW_KEEPALIVE))
         return;
 
     // LOAD_ONLY_FROM_CACHE and LOAD_NO_NETWORK_IO must not hit network.
     // LOAD_FROM_CACHE and LOAD_CHECK_OFFLINE_CACHE are unlikely to hit network,
     // so skip preconnects for them.
     if (mLoadFlags & (LOAD_ONLY_FROM_CACHE | LOAD_FROM_CACHE |
                       LOAD_NO_NETWORK_IO | LOAD_CHECK_OFFLINE_CACHE))
         return;
-    
+
     nsCOMPtr<nsIInterfaceRequestor> callbacks;
     NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup,
                                            getter_AddRefs(callbacks));
     if (!callbacks)
         return;
 
     mConnectionInfo->SetAnonymous((mLoadFlags & LOAD_ANONYMOUS) != 0);
     mConnectionInfo->SetPrivate(mPrivateBrowsing);
@@ -545,17 +545,17 @@ nsHttpChannel::DoNotifyListenerCleanup()
     // We don't need this info anymore
     CleanRedirectCacheChainIfNecessary();
 }
 
 void
 nsHttpChannel::HandleAsyncRedirect()
 {
     NS_PRECONDITION(!mCallOnResume, "How did that happen?");
-    
+
     if (mSuspendCount) {
         LOG(("Waiting until resume to do async redirect [this=%p]\n", this));
         mCallOnResume = &nsHttpChannel::HandleAsyncRedirect;
         return;
     }
 
     nsresult rv = NS_OK;
 
@@ -605,24 +605,24 @@ nsHttpChannel::ContinueHandleAsyncRedire
 
     return NS_OK;
 }
 
 void
 nsHttpChannel::HandleAsyncNotModified()
 {
     NS_PRECONDITION(!mCallOnResume, "How did that happen?");
-    
+
     if (mSuspendCount) {
         LOG(("Waiting until resume to do async not-modified [this=%p]\n",
              this));
         mCallOnResume = &nsHttpChannel::HandleAsyncNotModified;
         return;
     }
-    
+
     LOG(("nsHttpChannel::HandleAsyncNotModified [this=%p]\n", this));
 
     DoNotifyListener();
 
     CloseCacheEntry(true);
 
     mIsPending = false;
 
@@ -870,17 +870,17 @@ nsHttpChannel::SetupTransaction()
                             NS_GetCurrentThread(), callbacks, this,
                             getter_AddRefs(responseStream));
     if (NS_FAILED(rv)) {
         mTransaction = nullptr;
         return rv;
     }
 
     SetupTransactionLoadGroupInfo();
-    
+
     rv = nsInputStreamPump::Create(getter_AddRefs(mTransactionPump),
                                    responseStream);
     return rv;
 }
 
 // NOTE: This function duplicates code from nsBaseChannel. This will go away
 // once HTTP uses nsBaseChannel (part of bug 312760)
 static void
@@ -909,17 +909,17 @@ nsHttpChannel::CallOnStartRequest()
 
         nsIChannel* thisChannel = static_cast<nsIChannel*>(this);
 
         bool typeSniffersCalled = false;
         if (mCachePump) {
           typeSniffersCalled =
             NS_SUCCEEDED(mCachePump->PeekStream(CallTypeSniffers, thisChannel));
         }
-        
+
         if (!typeSniffersCalled && mTransactionPump) {
           mTransactionPump->PeekStream(CallTypeSniffers, thisChannel);
         }
     }
 
     bool shouldSniff = mResponseHead && (mResponseHead->ContentType().IsEmpty() ||
         ((mResponseHead->ContentType().EqualsLiteral(APPLICATION_OCTET_STREAM) &&
         (mLoadFlags & LOAD_TREAT_APPLICATION_OCTET_STREAM_AS_UNKNOWN))));
@@ -985,17 +985,17 @@ nsHttpChannel::CallOnStartRequest()
     }
 
     if (!mCanceled) {
         // create offline cache entry if offline caching was requested
         if (ShouldUpdateOfflineCacheEntry()) {
             LOG(("writing to the offline cache"));
             rv = InitOfflineCacheEntry();
             if (NS_FAILED(rv)) return rv;
-            
+
             // InitOfflineCacheEntry may have closed mOfflineCacheEntry
             if (mOfflineCacheEntry) {
                 rv = InstallOfflineCacheListener();
                 if (NS_FAILED(rv)) return rv;
             }
         } else if (mApplicationCacheForWrite) {
             LOG(("offline cache is up to date, not updating"));
             CloseOfflineCacheEntry();
@@ -1017,67 +1017,67 @@ nsHttpChannel::ProcessFailedProxyConnect
     // Our current architecture would parse the proxy's response content with
     // the permission of the target URL.  Given #4, we must avoid rendering the
     // body of the reply, and instead give the user a (hopefully helpful)
     // boilerplate error page, based on just the HTTP status of the reply.
 
     MOZ_ASSERT(mConnectionInfo->UsingConnect(),
                "proxy connect failed but not using CONNECT?");
     nsresult rv;
-    switch (httpStatus) 
+    switch (httpStatus)
     {
     case 300: case 301: case 302: case 303: case 307: case 308:
         // Bad redirect: not top-level, or it's a POST, bad/missing Location,
         // or ProcessRedirect() failed for some other reason.  Legal
         // redirects that fail because site not available, etc., are handled
         // elsewhere, in the regular codepath.
         rv = NS_ERROR_CONNECTION_REFUSED;
         break;
     case 403: // HTTP/1.1: "Forbidden"
     case 407: // ProcessAuthentication() failed
     case 501: // HTTP/1.1: "Not Implemented"
         // user sees boilerplate Mozilla "Proxy Refused Connection" page.
-        rv = NS_ERROR_PROXY_CONNECTION_REFUSED; 
+        rv = NS_ERROR_PROXY_CONNECTION_REFUSED;
         break;
     // Squid sends 404 if DNS fails (regular 404 from target is tunneled)
     case 404: // HTTP/1.1: "Not Found"
     // RFC 2616: "some deployed proxies are known to return 400 or 500 when
     // DNS lookups time out."  (Squid uses 500 if it runs out of sockets: so
     // we have a conflict here).
     case 400: // HTTP/1.1 "Bad Request"
     case 500: // HTTP/1.1: "Internal Server Error"
         /* User sees: "Address Not Found: Firefox can't find the server at
          * www.foo.com."
          */
-        rv = NS_ERROR_UNKNOWN_HOST; 
+        rv = NS_ERROR_UNKNOWN_HOST;
         break;
     case 502: // HTTP/1.1: "Bad Gateway" (invalid resp from target server)
     // Squid returns 503 if target request fails for anything but DNS.
     case 503: // HTTP/1.1: "Service Unavailable"
         /* User sees: "Failed to Connect:
          *  Firefox can't establish a connection to the server at
          *  www.foo.com.  Though the site seems valid, the browser
          *  was unable to establish a connection."
          */
         rv = NS_ERROR_CONNECTION_REFUSED;
         break;
     // RFC 2616 uses 504 for both DNS and target timeout, so not clear what to
     // do here: picking target timeout, as DNS covered by 400/404/500
-    case 504: // HTTP/1.1: "Gateway Timeout" 
+    case 504: // HTTP/1.1: "Gateway Timeout"
         // user sees: "Network Timeout: The server at www.foo.com
         //              is taking too long to respond."
         rv = NS_ERROR_NET_TIMEOUT;
         break;
     // Confused proxy server or malicious response
     default:
-        rv = NS_ERROR_PROXY_CONNECTION_REFUSED; 
+        rv = NS_ERROR_PROXY_CONNECTION_REFUSED;
         break;
     }
     LOG(("Cancelling failed proxy CONNECT [this=%p httpStatus=%u]\n",
-         this, httpStatus)); 
+         this, httpStatus));
     Cancel(rv);
     CallOnStartRequest();
     return rv;
 }
 
 /**
  * Decide whether or not to remember Strict-Transport-Security, and whether
  * or not to enforce channel integrity.
@@ -1897,42 +1897,42 @@ nsHttpChannel::EnsureAssocReq()
         return NS_OK;
 
     const char *assoc_val = mResponseHead->PeekHeader(nsHttp::Assoc_Req);
     if (!assoc_val)
         return NS_OK;
 
     if (!mTransaction || !mURI)
         return NS_OK;
-    
+
     if (!mTransaction->PipelinePosition()) {
         // "Pragma: X-Verify-Assoc-Req" can be used to verify even non pipelined
         // transactions. It is used by test harness.
 
         const char *pragma_val = mResponseHead->PeekHeader(nsHttp::Pragma);
         if (!pragma_val ||
             !nsHttp::FindToken(pragma_val, "X-Verify-Assoc-Req",
                                HTTP_HEADER_VALUE_SEPS))
             return NS_OK;
     }
 
     char *method = net_FindCharNotInSet(assoc_val, HTTP_LWS);
     if (!method)
         return NS_OK;
-    
+
     bool equals;
     char *endofmethod;
-    
+
     assoc_val = nullptr;
     endofmethod = net_FindCharInSet(method, HTTP_LWS);
     if (endofmethod)
         assoc_val = net_FindCharNotInSet(endofmethod, HTTP_LWS);
     if (!assoc_val)
         return NS_OK;
-    
+
     // check the method
     int32_t methodlen = strlen(mRequestHead.Method().get());
     if ((methodlen != (endofmethod - method)) ||
         PL_strncmp(method,
                    mRequestHead.Method().get(),
                    endofmethod - method)) {
         LOG(("  Assoc-Req failure Method %s", method));
         if (mConnectionInfo)
@@ -1953,17 +1953,17 @@ nsHttpChannel::EnsureAssocReq()
             AppendASCIItoUTF16(mRequestHead.Method().get(), message);
             consoleService->LogStringMessage(message.get());
         }
 
         if (gHttpHandler->EnforceAssocReq())
             return NS_ERROR_CORRUPTED_CONTENT;
         return NS_OK;
     }
-    
+
     // check the URL
     nsCOMPtr<nsIURI> assoc_url;
     if (NS_FAILED(NS_NewURI(getter_AddRefs(assoc_url), assoc_val)) ||
         !assoc_url)
         return NS_OK;
 
     mURI->Equals(assoc_url, &equals);
     if (!equals) {
@@ -2028,24 +2028,24 @@ HttpCacheQuery::SetupByteRangeRequest(ui
 nsresult
 nsHttpChannel::ProcessPartialContent()
 {
     // ok, we've just received a 206
     //
     // we need to stream whatever data is in the cache out first, and then
     // pick up whatever data is on the wire, writing it into the cache.
 
-    LOG(("nsHttpChannel::ProcessPartialContent [this=%p]\n", this)); 
+    LOG(("nsHttpChannel::ProcessPartialContent [this=%p]\n", this));
 
     NS_ENSURE_TRUE(mCachedResponseHead, NS_ERROR_NOT_INITIALIZED);
     NS_ENSURE_TRUE(mCacheEntry, NS_ERROR_NOT_INITIALIZED);
 
     // Make sure to clear bogus content-encodings before looking at the header
     ClearBogusContentEncodingIfNeeded();
-    
+
     // Check if the content-encoding we now got is different from the one we
     // got before
     if (PL_strcasecmp(mResponseHead->PeekHeader(nsHttp::Content_Encoding),
                       mCachedResponseHead->PeekHeader(nsHttp::Content_Encoding))
                       != 0) {
         Cancel(NS_ERROR_INVALID_CONTENT_ENCODING);
         return CallOnStartRequest();
     }
@@ -2123,20 +2123,20 @@ nsHttpChannel::OnDoneReadingPartialCache
 // nsHttpChannel <cache>
 //-----------------------------------------------------------------------------
 
 nsresult
 nsHttpChannel::ProcessNotModified()
 {
     nsresult rv;
 
-    LOG(("nsHttpChannel::ProcessNotModified [this=%p]\n", this)); 
+    LOG(("nsHttpChannel::ProcessNotModified [this=%p]\n", this));
 
     if (mCustomConditionalRequest) {
-        LOG(("Bypassing ProcessNotModified due to custom conditional headers")); 
+        LOG(("Bypassing ProcessNotModified due to custom conditional headers"));
         return NS_ERROR_FAILURE;
     }
 
     if (!mDidReval) {
         LOG(("Server returned a 304 response even though we did not send a "
              "conditional request"));
         return NS_ERROR_FAILURE;
     }
@@ -2153,17 +2153,17 @@ nsHttpChannel::ProcessNotModified()
     // right track as well as disabling pipelining for that host.
 
     nsAutoCString lastModifiedCached;
     nsAutoCString lastModified304;
 
     rv = mCachedResponseHead->GetHeader(nsHttp::Last_Modified,
                                         lastModifiedCached);
     if (NS_SUCCEEDED(rv)) {
-        rv = mResponseHead->GetHeader(nsHttp::Last_Modified, 
+        rv = mResponseHead->GetHeader(nsHttp::Last_Modified,
                                       lastModified304);
     }
 
     if (NS_SUCCEEDED(rv) && !lastModified304.Equals(lastModifiedCached)) {
         LOG(("Cache Entry and 304 Last-Modified Headers Do Not Match "
              "[%s] and [%s]\n",
              lastModifiedCached.get(), lastModified304.get()));
 
@@ -2542,17 +2542,17 @@ nsHttpChannel::OpenNormalCacheEntry(bool
 
     nsAutoCString cacheKey;
     GenerateCacheKey(mPostID, cacheKey);
 
     nsCacheAccessMode accessRequested;
     rv = DetermineCacheAccess(&accessRequested);
     if (NS_FAILED(rv))
         return rv;
- 
+
     mCacheQuery = new HttpCacheQuery(
                                 this, clientID, storagePolicy,
                                 mPrivateBrowsing, cacheKey, accessRequested,
                                 mLoadFlags & LOAD_BYPASS_LOCAL_CACHE_IF_BUSY,
                                 usingSSL, false);
 
     mOnCacheEntryAvailableCallback =
         &nsHttpChannel::OnNormalCacheEntryAvailable;
@@ -2738,23 +2738,23 @@ nsHttpChannel::AssembleCacheKey(const ch
     if (p)
         cacheKey.Append(spec, p - spec);
     else
         cacheKey.Append(spec);
 }
 
 // UpdateExpirationTime is called when a new response comes in from the server.
 // It updates the stored response-time and sets the expiration time on the
-// cache entry.  
+// cache entry.
 //
 // From section 13.2.4 of RFC2616, we compute expiration time as follows:
 //
 //    timeRemaining = freshnessLifetime - currentAge
 //    expirationTime = now + timeRemaining
-// 
+//
 nsresult
 nsHttpChannel::UpdateExpirationTime()
 {
     NS_ENSURE_TRUE(mResponseHead, NS_ERROR_FAILURE);
 
     nsresult rv;
 
     uint32_t expirationTime = 0;
@@ -2762,17 +2762,17 @@ nsHttpChannel::UpdateExpirationTime()
         uint32_t freshnessLifetime = 0;
 
         rv = mResponseHead->ComputeFreshnessLifetime(&freshnessLifetime);
         if (NS_FAILED(rv)) return rv;
 
         if (freshnessLifetime > 0) {
             uint32_t now = NowInSeconds(), currentAge = 0;
 
-            rv = mResponseHead->ComputeCurrentAge(now, mRequestTime, &currentAge); 
+            rv = mResponseHead->ComputeCurrentAge(now, mRequestTime, &currentAge);
             if (NS_FAILED(rv)) return rv;
 
             LOG(("freshnessLifetime = %u, currentAge = %u\n",
                 freshnessLifetime, currentAge));
 
             if (freshnessLifetime > currentAge) {
                 uint32_t timeRemaining = freshnessLifetime - currentAge;
                 // be careful... now + timeRemaining may overflow
@@ -2807,17 +2807,17 @@ nsresult
 HttpCacheQuery::Dispatch()
 {
     MOZ_ASSERT(NS_IsMainThread());
 
     nsresult rv;
 
     // XXX: Start the cache service; otherwise DispatchToCacheIOThread will
     // fail.
-    nsCOMPtr<nsICacheService> service = 
+    nsCOMPtr<nsICacheService> service =
         do_GetService(NS_CACHESERVICE_CONTRACTID, &rv);
 
     // Ensure the stream transport service gets initialized on the main thread
     if (NS_SUCCEEDED(rv)) {
         nsCOMPtr<nsIStreamTransportService> sts =
             do_GetService(kStreamTransportServiceCID, &rv);
     }
 
@@ -2867,17 +2867,17 @@ HttpCacheQuery::Run()
     } else {
         // break cycles
         nsCOMPtr<nsICacheListener> channel = mChannel.forget();
         mCacheThread = nullptr;
         nsCOMPtr<nsICacheEntryDescriptor> entry = mCacheEntry.forget();
 
         rv = channel->OnCacheEntryAvailable(entry, mCacheAccess, mStatus);
     }
-    
+
     return rv;
 }
 
 NS_IMETHODIMP
 HttpCacheQuery::OnCacheEntryAvailable(nsICacheEntryDescriptor *entry,
                                       nsCacheAccessMode access,
                                       nsresult status)
 
@@ -3143,17 +3143,17 @@ HttpCacheQuery::CheckCache()
 
     if (!doValidation && mRequestHead.PeekHeader(nsHttp::If_Match) &&
         (method == nsHttp::Get || method == nsHttp::Head)) {
         const char *requestedETag, *cachedETag;
         cachedETag = mCachedResponseHead->PeekHeader(nsHttp::ETag);
         requestedETag = mRequestHead.PeekHeader(nsHttp::If_Match);
         if (cachedETag && (!strncmp(cachedETag, "W/", 2) ||
             strcmp(requestedETag, cachedETag))) {
-            // User has defined If-Match header, if the cached entry is not 
+            // User has defined If-Match header, if the cached entry is not
             // matching the provided header value or the cached ETag is weak,
             // force validation.
             doValidation = true;
         }
     }
 
     if (!doValidation) {
         //
@@ -3364,17 +3364,17 @@ HttpCacheQuery::OpenCacheInputStream(boo
         // return an entity to the application when we process redirects.
         LOG(("Will skip read of cached redirect entity\n"));
         return NS_OK;
     }
 
     if ((mLoadFlags & nsICachingChannel::LOAD_ONLY_IF_MODIFIED) &&
         !mCachedContentIsPartial) {
         // For LOAD_ONLY_IF_MODIFIED, we usually don't have to deal with the
-        // cached entity. 
+        // cached entity.
         if (!mCacheForOfflineUse) {
             LOG(("Will skip read from cache based on LOAD_ONLY_IF_MODIFIED "
                  "load flag\n"));
             return NS_OK;
         }
 
         // If offline caching has been requested and the offline cache needs
         // updating, we must complete the call even if the main cache entry
@@ -3408,17 +3408,17 @@ HttpCacheQuery::OpenCacheInputStream(boo
               "mCacheEntry=%p, stream=%p]", mChannel.get(),
               mCacheEntry.get(), stream.get()));
         mCacheInputStream.takeOver(stream);
         return rv;
     }
 
     // Have the stream transport service start reading the entity on one of its
     // background threads.
-    
+
     nsCOMPtr<nsITransport> transport;
     nsCOMPtr<nsIInputStream> wrapper;
 
     nsCOMPtr<nsIStreamTransportService> sts =
         do_GetService(kStreamTransportServiceCID, &rv);
     if (NS_SUCCEEDED(rv)) {
         rv = sts->CreateInputTransport(stream, int64_t(-1), int64_t(-1),
                                         true, getter_AddRefs(transport));
@@ -3429,17 +3429,17 @@ HttpCacheQuery::OpenCacheInputStream(boo
     if (NS_SUCCEEDED(rv)) {
         LOG(("Opened cache input stream [channel=%p, wrapper=%p, "
               "transport=%p, stream=%p]", this, wrapper.get(),
               transport.get(), stream.get()));
     } else {
         LOG(("Failed to open cache input stream [channel=%p, "
               "wrapper=%p, transport=%p, stream=%p]", this,
               wrapper.get(), transport.get(), stream.get()));
-    
+
         stream->Close();
         return rv;
     }
 
     mCacheInputStream.takeOver(wrapper);
 
     return NS_OK;
 }
@@ -3455,17 +3455,17 @@ nsHttpChannel::ReadFromCache(bool alread
     LOG(("nsHttpChannel::ReadFromCache [this=%p] "
          "Using cached copy of: %s\n", this, mSpec.get()));
 
     if (mCachedResponseHead)
         mResponseHead = mCachedResponseHead;
 
     UpdateInhibitPersistentCachingFlag();
 
-    // if we don't already have security info, try to get it from the cache 
+    // if we don't already have security info, try to get it from the cache
     // entry. there are two cases to consider here: 1) we are just reading
     // from the cache, or 2) this may be due to a 304 not modified response,
     // in which case we could have security info from a socket transport.
     if (!mSecurityInfo)
         mSecurityInfo = mCachedSecurityInfo;
 
     if (!alreadyMarkedValid && !mCachedContentIsPartial) {
         // We validated the entry, and we have write access to the cache, so
@@ -3484,27 +3484,27 @@ nsHttpChannel::ReadFromCache(bool alread
 
     if (WillRedirect(mResponseHead)) {
         // TODO: Bug 759040 - We should call HandleAsyncRedirect directly here,
         // to avoid event dispatching latency.
         MOZ_ASSERT(!mCacheInputStream);
         LOG(("Skipping skip read of cached redirect entity\n"));
         return AsyncCall(&nsHttpChannel::HandleAsyncRedirect);
     }
-    
+
     if ((mLoadFlags & LOAD_ONLY_IF_MODIFIED) && !mCachedContentIsPartial) {
         if (!mApplicationCacheForWrite) {
             LOG(("Skipping read from cache based on LOAD_ONLY_IF_MODIFIED "
                  "load flag\n"));
             MOZ_ASSERT(!mCacheInputStream);
             // TODO: Bug 759040 - We should call HandleAsyncNotModified directly
             // here, to avoid event dispatching latency.
             return AsyncCall(&nsHttpChannel::HandleAsyncNotModified);
         }
-        
+
         if (!ShouldUpdateOfflineCacheEntry()) {
             LOG(("Skipping read from cache based on LOAD_ONLY_IF_MODIFIED "
                  "load flag (mApplicationCacheForWrite not null case)\n"));
             mCacheInputStream.CloseAndRelease();
             // TODO: Bug 759040 - We should call HandleAsyncNotModified directly
             // here, to avoid event dispatching latency.
             return AsyncCall(&nsHttpChannel::HandleAsyncNotModified);
         }
@@ -3514,17 +3514,17 @@ nsHttpChannel::ReadFromCache(bool alread
     if (!mCacheInputStream) {
         NS_ERROR("mCacheInputStream is null but we're expecting to "
                         "be able to read from it.");
         return NS_ERROR_UNEXPECTED;
     }
 
 
     nsCOMPtr<nsIInputStream> inputStream = mCacheInputStream.forget();
- 
+
     rv = nsInputStreamPump::Create(getter_AddRefs(mCachePump), inputStream,
                                    int64_t(-1), int64_t(-1), 0, 0, true);
     if (NS_FAILED(rv)) {
         inputStream->Close();
         return rv;
     }
 
     rv = mCachePump->AsyncRead(this, mListenerContext);
@@ -3725,17 +3725,17 @@ nsHttpChannel::AddCacheEntryHeaders(nsIC
     // in the cache.  we could try to avoid needlessly storing the "accept"
     // header in this case, but it doesn't seem worth the extra code to perform
     // the check.
     {
         nsAutoCString buf, metaKey;
         mResponseHead->GetHeader(nsHttp::Vary, buf);
         if (!buf.IsEmpty()) {
             NS_NAMED_LITERAL_CSTRING(prefix, "request-");
-           
+
             char *val = buf.BeginWriting(); // going to munge buf
             char *token = nsCRT::strtok(val, NS_HTTP_HEADER_SEPS, &val);
             while (token) {
                 LOG(("nsHttpChannel::AddCacheEntryHeaders [this=%x] " \
                         "processing %s", this, token));
                 if (*token != '*') {
                     nsHttpAtom atom = nsHttp::ResolveAtom(token);
                     const char *val = mRequestHead.PeekHeader(atom);
@@ -3844,21 +3844,21 @@ nsHttpChannel::InstallCacheListener(uint
          mResponseHead->ContentType().EqualsLiteral(TEXT_CSS) ||
          mResponseHead->ContentType().EqualsLiteral(TEXT_JAVASCRIPT) ||
          mResponseHead->ContentType().EqualsLiteral(TEXT_ECMASCRIPT) ||
          mResponseHead->ContentType().EqualsLiteral(TEXT_XML) ||
          mResponseHead->ContentType().EqualsLiteral(APPLICATION_JAVASCRIPT) ||
          mResponseHead->ContentType().EqualsLiteral(APPLICATION_ECMASCRIPT) ||
          mResponseHead->ContentType().EqualsLiteral(APPLICATION_XJAVASCRIPT) ||
          mResponseHead->ContentType().EqualsLiteral(APPLICATION_XHTML_XML))) {
-        rv = mCacheEntry->SetMetaDataElement("uncompressed-len", "0"); 
+        rv = mCacheEntry->SetMetaDataElement("uncompressed-len", "0");
         if (NS_FAILED(rv)) {
             LOG(("unable to mark cache entry for compression"));
         }
-    } 
+    }
 
     LOG(("Trading cache input stream for output stream [channel=%p]", this));
 
     // We must close the input stream first because cache entries do not
     // correctly handle having an output stream and input streams open at
     // the same time.
     mCacheInputStream.CloseAndRelease();
 
@@ -3949,17 +3949,17 @@ nsHttpChannel::ClearBogusContentEncoding
     }
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel <redirect>
 //-----------------------------------------------------------------------------
 
 nsresult
-nsHttpChannel::SetupReplacementChannel(nsIURI       *newURI, 
+nsHttpChannel::SetupReplacementChannel(nsIURI       *newURI,
                                        nsIChannel   *newChannel,
                                        bool          preserveMethod)
 {
     LOG(("nsHttpChannel::SetupReplacementChannel "
          "[this=%p newChannel=%p preserveMethod=%d]",
          this, newChannel, preserveMethod));
 
     nsresult rv = HttpBaseChannel::SetupReplacementChannel(newURI, newChannel, preserveMethod);
@@ -4025,17 +4025,17 @@ nsHttpChannel::AsyncProcessRedirection(u
 
     if (NS_FAILED(rv)) {
         LOG(("Invalid URI for redirect: Location: %s\n", location));
         return NS_ERROR_CORRUPTED_CONTENT;
     }
 
     if (mApplicationCache) {
         // if we are redirected to a different origin check if there is a fallback
-        // cache entry to fall back to. we don't care about file strict 
+        // cache entry to fall back to. we don't care about file strict
         // checking, at least mURI is not a file URI.
         if (!NS_SecurityCompareURIs(mURI, mRedirectURI, false)) {
             PushRedirectAsyncFunc(&nsHttpChannel::ContinueProcessRedirectionAfterFallback);
             bool waitingForRedirectCallback;
             (void)ProcessFallback(&waitingForRedirectCallback);
             if (waitingForRedirectCallback)
                 return NS_OK;
             PopRedirectAsyncFunc(&nsHttpChannel::ContinueProcessRedirectionAfterFallback);
@@ -4092,17 +4092,17 @@ nsHttpChannel::ContinueProcessRedirectio
             // NOTE: SetRef will fail if mRedirectURI is immutable
             // (e.g. an about: URI)... Oh well.
             mRedirectURI->SetRef(ref);
         }
     }
 
     bool rewriteToGET = nsHttp::ShouldRewriteRedirectToGET(
                                     mRedirectType, mRequestHead.Method());
-      
+
     // prompt if the method is not safe (such as POST, PUT, DELETE, ...)
     if (!rewriteToGET &&
         !nsHttp::IsSafeMethod(mRequestHead.Method())) {
         rv = PromptTempRedirect();
         if (NS_FAILED(rv)) return rv;
     }
 
     nsCOMPtr<nsIIOService> ioService;
@@ -4169,17 +4169,17 @@ nsHttpChannel::ContinueProcessRedirectio
     // begin loading the new channel
     rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
 
     if (NS_FAILED(rv))
         return rv;
 
     // close down this channel
     Cancel(NS_BINDING_REDIRECTED);
-    
+
     notifier.RedirectSucceeded();
 
     ReleaseListeners();
 
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
@@ -4192,17 +4192,17 @@ NS_IMETHODIMP nsHttpChannel::OnAuthAvail
 
     // setting mAuthRetryPending flag and resuming the transaction
     // triggers process of throwing away the unauthenticated data already
     // coming from the network
     mAuthRetryPending = true;
     mProxyAuthPending = false;
     LOG(("Resuming the transaction, we got credentials from user"));
     mTransactionPump->Resume();
-  
+
     return NS_OK;
 }
 
 NS_IMETHODIMP nsHttpChannel::OnAuthCancelled(bool userCancel)
 {
     LOG(("nsHttpChannel::OnAuthCancelled [this=%p]", this));
 
     if (mTransactionPump) {
@@ -4297,36 +4297,36 @@ nsHttpChannel::Cancel(nsresult status)
         mAuthProvider->Cancel(status);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHttpChannel::Suspend()
 {
     NS_ENSURE_TRUE(mIsPending, NS_ERROR_NOT_AVAILABLE);
-    
+
     LOG(("nsHttpChannel::Suspend [this=%p]\n", this));
 
     ++mSuspendCount;
 
     if (mTransactionPump)
         return mTransactionPump->Suspend();
     if (mCachePump)
         return mCachePump->Suspend();
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHttpChannel::Resume()
 {
     NS_ENSURE_TRUE(mSuspendCount > 0, NS_ERROR_UNEXPECTED);
-    
+
     LOG(("nsHttpChannel::Resume [this=%p]\n", this));
-        
+
     if (--mSuspendCount == 0 && mCallOnResume) {
         nsresult rv = AsyncCall(mCallOnResume);
         mCallOnResume = nullptr;
         NS_ENSURE_SUCCESS(rv, rv);
     }
 
     if (mTransactionPump)
         return mTransactionPump->Resume();
@@ -4474,38 +4474,38 @@ nsHttpChannel::BeginConnect()
         if (gHttpHandler->ProxyPipelining())
             mCaps |= NS_HTTP_ALLOW_PIPELINING;
     }
 
     // if this somehow fails we can go on without it
     gHttpHandler->AddConnectionHeader(&mRequestHead.Headers(), mCaps);
 
     if (!mConnectionInfo->UsingHttpProxy()) {
-        // Start a DNS lookup very early in case the real open is queued the DNS can 
-        // happen in parallel. Do not do so in the presence of an HTTP proxy as 
+        // Start a DNS lookup very early in case the real open is queued the DNS can
+        // happen in parallel. Do not do so in the presence of an HTTP proxy as
         // all lookups other than for the proxy itself are done by the proxy.
         //
         // We keep the DNS prefetch object around so that we can retrieve
         // timing information from it. There is no guarantee that we actually
         // use the DNS prefetch data for the real connection, but as we keep
         // this data around for 3 minutes by default, this should almost always
         // be correct, and even when it isn't, the timing still represents _a_
         // valid DNS lookup timing for the site, even if it is not _the_
         // timing we used.
         mDNSPrefetch = new nsDNSPrefetch(mURI, mTimingEnabled);
         mDNSPrefetch->PrefetchHigh();
     }
-    
+
     // Adjust mCaps according to our request headers:
     //  - If "Connection: close" is set as a request header, then do not bother
     //    trying to establish a keep-alive connection.
     if (mRequestHead.HasHeaderValue(nsHttp::Connection, "close"))
         mCaps &= ~(NS_HTTP_ALLOW_KEEPALIVE | NS_HTTP_ALLOW_PIPELINING);
-    
-    if ((mLoadFlags & VALIDATE_ALWAYS) || 
+
+    if ((mLoadFlags & VALIDATE_ALWAYS) ||
         (BYPASS_LOCAL_CACHE(mLoadFlags)))
         mCaps |= NS_HTTP_REFRESH_DNS;
 
     if (gHttpHandler->CritialRequestPrioritization()) {
         if (mLoadAsBlocking)
             mCaps |= NS_HTTP_LOAD_AS_BLOCKING;
         if (mLoadUnblocked)
             mCaps |= NS_HTTP_LOAD_UNBLOCKED;
@@ -4590,17 +4590,17 @@ nsHttpChannel::OnProxyAvailable(nsICance
     mProxyRequest = nullptr;
 
     nsresult rv;
 
     // If status is a failure code, then it means that we failed to resolve
     // proxy info.  That is a non-fatal error assuming it wasn't because the
     // request was canceled.  We just failover to DIRECT when proxy resolution
     // fails (failure can mean that the PAC URL could not be loaded).
-    
+
     if (NS_SUCCEEDED(status))
         mProxyInfo = pi;
 
     if (!gHttpHandler->Active()) {
         LOG(("nsHttpChannel::OnProxyAvailable [this=%p] "
              "Handler no longer active.\n", this));
         rv = NS_ERROR_NOT_AVAILABLE;
     }
@@ -4996,17 +4996,17 @@ nsHttpChannel::OnStopRequest(nsIRequest 
                     return status;
                 // otherwise, fall through and fire OnStopRequest...
             }
             else
                 NS_NOTREACHED("unexpected request");
         }
         // Do not to leave the transaction in a suspended state in error cases.
         if (NS_FAILED(status) && mTransaction)
-            gHttpHandler->CancelTransaction(mTransaction, status); 
+            gHttpHandler->CancelTransaction(mTransaction, status);
     }
 
     if (mTransaction) {
         // determine if we should call DoAuthRetry
         bool authRetry = mAuthRetryPending && NS_SUCCEEDED(status);
 
         //
         // grab references to connection in case we need to retry an
@@ -5025,17 +5025,17 @@ nsHttpChannel::OnStopRequest(nsIRequest 
             // for details.
             if (conn && !conn->IsPersistent())
                 conn = nullptr;
         }
 
         nsRefPtr<nsAHttpConnection> stickyConn;
         if (mCaps & NS_HTTP_STICKY_CONNECTION)
             stickyConn = mTransaction->Connection();
-        
+
         // at this point, we're done with the transaction
         mTransactionTimings = mTransaction->Timings();
         mTransaction = nullptr;
         mTransactionPump = 0;
 
         // We no longer need the dns prefetch object
         if (mDNSPrefetch && mDNSPrefetch->TimingsValid()) {
             mTransactionTimings.domainLookupStart =
@@ -5060,33 +5060,33 @@ nsHttpChannel::OnStopRequest(nsIRequest 
             // NOTE: since we have a failure status, we can ignore the return
             // value from onStartRequest.
             mListener->OnStartRequest(this, mListenerContext);
         }
 
         // if this transaction has been replaced, then bail.
         if (mTransactionReplaced)
             return NS_OK;
-        
+
         if (mUpgradeProtocolCallback && stickyConn &&
             mResponseHead && mResponseHead->Status() == 101) {
             gHttpHandler->ConnMgr()->CompleteUpgrade(stickyConn,
                                                      mUpgradeProtocolCallback);
         }
     }
 
     mIsPending = false;
     mStatus = status;
 
     // perform any final cache operations before we close the cache entry.
     if (mCacheEntry && (mCacheAccess & nsICache::ACCESS_WRITE) &&
         mRequestTimeInitialized){
         FinalizeCacheEntry();
     }
-    
+
     if (mListener) {
         LOG(("  calling OnStopRequest\n"));
         mListener->OnStopRequest(this, mListenerContext, status);
     }
 
     MOZ_EVENT_TRACER_DONE(this, "net::http::channel");
 
     CloseCacheEntry(!contentComplete);
@@ -5096,17 +5096,17 @@ nsHttpChannel::OnStopRequest(nsIRequest 
 
     if (mLoadGroup)
         mLoadGroup->RemoveRequest(this, nullptr, status);
 
     // We don't need this info anymore
     CleanRedirectCacheChainIfNecessary();
 
     ReleaseListeners();
-    
+
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
@@ -5152,17 +5152,17 @@ nsHttpChannel::OnDataAvailable(nsIReques
         uint64_t progressMax(uint64_t(mResponseHead->ContentLength()));
         uint64_t progress = mLogicalOffset + uint64_t(count);
         MOZ_ASSERT(progress <= progressMax, "unexpected progress values");
 
         OnTransportStatus(nullptr, transportStatus, progress, progressMax);
 
         //
         // we have to manually keep the logical offset of the stream up-to-date.
-        // we cannot depend solely on the offset provided, since we may have 
+        // we cannot depend solely on the offset provided, since we may have
         // already streamed some data from another source (see, for example,
         // OnDoneReadingPartialCacheEntry).
         //
         if (!mLogicalOffset)
             MOZ_EVENT_TRACER_EXEC(this, "net::http::channel");
 
         nsresult rv =  mListener->OnDataAvailable(this,
                                                   mListenerContext,
@@ -5216,17 +5216,17 @@ nsHttpChannel::OnTransportStatus(nsITran
     }
 #ifdef DEBUG
     else
         LOG(("skipping status notification [this=%p sink=%p pending=%u background=%x]\n",
             this, mProgressSink.get(), mIsPending, (mLoadFlags & LOAD_BACKGROUND)));
 #endif
 
     return NS_OK;
-} 
+}
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsICacheInfoChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsHttpChannel::IsFromCache(bool *value)
 {
@@ -5315,28 +5315,28 @@ nsHttpChannel::SetOfflineCacheToken(nsIS
 
 class nsHttpChannelCacheKey MOZ_FINAL : public nsISupportsPRUint32,
                                         public nsISupportsCString
 {
     NS_DECL_ISUPPORTS
 
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_FORWARD_NSISUPPORTSPRUINT32(mSupportsPRUint32->)
-    
+
     // Both interfaces declares toString method with the same signature.
     // Thus we have to delegate only to nsISupportsPRUint32 implementation.
-    NS_IMETHOD GetData(nsACString & aData) 
-    { 
+    NS_IMETHOD GetData(nsACString & aData)
+    {
         return mSupportsCString->GetData(aData);
     }
     NS_IMETHOD SetData(const nsACString & aData)
-    { 
+    {
         return mSupportsCString->SetData(aData);
     }
-    
+
 public:
     nsresult SetData(uint32_t aPostID, const nsACString& aKey);
 
 protected:
     nsCOMPtr<nsISupportsPRUint32> mSupportsPRUint32;
     nsCOMPtr<nsISupportsCString> mSupportsCString;
 };
 
@@ -5363,24 +5363,24 @@ NS_IMETHODIMP nsHttpChannelCacheKey::Get
     return NS_OK;
 }
 
 nsresult nsHttpChannelCacheKey::SetData(uint32_t aPostID,
                                         const nsACString& aKey)
 {
     nsresult rv;
 
-    mSupportsCString = 
+    mSupportsCString =
         do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv);
     if (NS_FAILED(rv)) return rv;
 
     mSupportsCString->SetData(aKey);
     if (NS_FAILED(rv)) return rv;
 
-    mSupportsPRUint32 = 
+    mSupportsPRUint32 =
         do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID, &rv);
     if (NS_FAILED(rv)) return rv;
 
     mSupportsPRUint32->SetData(aPostID);
     if (NS_FAILED(rv)) return rv;
 
     return NS_OK;
 }
@@ -5578,29 +5578,29 @@ nsHttpChannel::DoAuthRetry(nsAHttpConnec
     // the request headers (bug 95044).
     mIsPending = false;
 
     // fetch cookies, and add them to the request header.
     // the server response could have included cookies that must be sent with
     // this authentication attempt (bug 84794).
     // TODO: save cookies from auth response and send them here (bug 572151).
     AddCookiesToRequest();
-    
+
     // notify "http-on-modify-request" observers
     CallOnModifyRequestObservers();
 
     mIsPending = true;
 
     // get rid of the old response headers
     mResponseHead = nullptr;
 
     // set sticky connection flag and disable pipelining.
     mCaps |=  NS_HTTP_STICKY_CONNECTION;
     mCaps &= ~NS_HTTP_ALLOW_PIPELINING;
-   
+
     // and create a new one...
     rv = SetupTransaction();
     if (NS_FAILED(rv)) return rv;
 
     // transfer ownership of connection to transaction
     if (conn)
         mTransaction->SetConnection(conn);
 
@@ -5751,17 +5751,17 @@ nsHttpChannel::WaitForRedirectCallback()
     if (mTransactionPump) {
         rv = mTransactionPump->Suspend();
         NS_ENSURE_SUCCESS(rv, rv);
     }
     if (mCachePump) {
         rv = mCachePump->Suspend();
         if (NS_FAILED(rv) && mTransactionPump) {
 #ifdef DEBUG
-            nsresult resume = 
+            nsresult resume =
 #endif
             mTransactionPump->Resume();
             MOZ_ASSERT(NS_SUCCEEDED(resume),
                        "Failed to resume transaction pump");
         }
         NS_ENSURE_SUCCESS(rv, rv);
     }
 
@@ -5859,17 +5859,17 @@ nsHttpChannel::MaybeInvalidateCacheEntry
        mRequestHead.Method() == nsHttp::Connect)
         return;
 
 
     // Invalidate the request-uri.
     // Pass 0 in first param to get the cache-key for a GET-request.
     nsAutoCString tmpCacheKey;
     GenerateCacheKey(0, tmpCacheKey);
-    LOG(("MaybeInvalidateCacheEntryForSubsequentGet [this=%p uri=%s]\n", 
+    LOG(("MaybeInvalidateCacheEntryForSubsequentGet [this=%p uri=%s]\n",
         this, tmpCacheKey.get()));
     DoInvalidateCacheEntry(tmpCacheKey);
 
     // Invalidate Location-header if set
     const char *location = mResponseHead->PeekHeader(nsHttp::Location);
     if (location) {
         LOG(("  Location-header=%s\n", location));
         InvalidateCacheEntryForLocation(location);
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -112,21 +112,21 @@ public:
     // nsISupportsPriority
     NS_IMETHOD SetPriority(int32_t value);
     // nsIResumableChannel
     NS_IMETHOD ResumeAt(uint64_t startPos, const nsACString& entityID);
 
     NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks);
     NS_IMETHOD SetLoadGroup(nsILoadGroup *aLoadGroup);
 
-public: /* internal necko use only */ 
+public: /* internal necko use only */
 
-    void InternalSetUploadStream(nsIInputStream *uploadStream) 
+    void InternalSetUploadStream(nsIInputStream *uploadStream)
       { mUploadStream = uploadStream; }
-    void SetUploadStreamHasHeaders(bool hasHeaders) 
+    void SetUploadStreamHasHeaders(bool hasHeaders)
       { mUploadStreamHasHeaders = hasHeaders; }
 
     nsresult SetReferrerInternal(nsIURI *referrer) {
         nsAutoCString spec;
         nsresult rv = referrer->GetAsciiSpec(spec);
         if (NS_FAILED(rv)) return rv;
         mReferrer = referrer;
         mRequestHead.SetHeader(nsHttp::Referer, spec);
@@ -243,17 +243,17 @@ private:
     nsresult DoAuthRetry(nsAHttpConnection *);
 
     void     HandleAsyncRedirectChannelToHttps();
     nsresult StartRedirectChannelToHttps();
     nsresult ContinueAsyncRedirectChannelToURI(nsresult rv);
     nsresult OpenRedirectChannel(nsresult rv);
 
     /**
-     * A function that takes care of reading STS headers and enforcing STS 
+     * A function that takes care of reading STS headers and enforcing STS
      * load rules.  After a secure channel is erected, STS requires the channel
      * to be trusted or any STS header data on the channel is ignored.
      * This is called from ProcessResponse.
      */
     nsresult ProcessSTSHeader();
 
     void InvalidateCacheEntryForLocation(const char *location);
     void AssembleCacheKey(const char *spec, uint32_t postID, nsACString &key);
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.h
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.h
@@ -95,17 +95,17 @@ private:
      * from the user. Called from OnAuthAvailable callback or OnAuthCancelled
      * when credentials for next challenge were obtained synchronously.
      */
     nsresult ContinueOnAuthAvailable(const nsCSubstring& creds);
 
     nsresult DoRedirectChannelToHttps();
 
     /**
-     * A function that takes care of reading STS headers and enforcing STS 
+     * A function that takes care of reading STS headers and enforcing STS
      * load rules.  After a secure channel is erected, STS requires the channel
      * to be trusted or any STS header data on the channel is ignored.
      * This is called from ProcessResponse.
      */
     nsresult ProcessSTSHeader();
 
 private:
     nsIHttpAuthenticableChannel      *mAuthChannel;  // weak ref
--- a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp
+++ b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp
@@ -15,36 +15,36 @@ nsresult
 nsHttpChunkedDecoder::HandleChunkedContent(char *buf,
                                            uint32_t count,
                                            uint32_t *contentRead,
                                            uint32_t *contentRemaining)
 {
     LOG(("nsHttpChunkedDecoder::HandleChunkedContent [count=%u]\n", count));
 
     *contentRead = 0;
-    
+
     // from RFC2617 section 3.6.1, the chunked transfer coding is defined as:
     //
     //   Chunked-Body    = *chunk
     //                     last-chunk
     //                     trailer
     //                     CRLF
     //   chunk           = chunk-size [ chunk-extension ] CRLF
     //                     chunk-data CRLF
     //   chunk-size      = 1*HEX
     //   last-chunk      = 1*("0") [ chunk-extension ] CRLF
-    //       
+    //
     //   chunk-extension = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
     //   chunk-ext-name  = token
     //   chunk-ext-val   = token | quoted-string
     //   chunk-data      = chunk-size(OCTET)
     //   trailer         = *(entity-header CRLF)
     //
     // the chunk-size field is a string of hex digits indicating the size of the
-    // chunk.  the chunked encoding is ended by any chunk whose size is zero, 
+    // chunk.  the chunked encoding is ended by any chunk whose size is zero,
     // followed by the trailer, which is terminated by an empty line.
 
     while (count) {
         if (mChunkRemaining) {
             uint32_t amt = std::min(mChunkRemaining, count);
 
             count -= amt;
             mChunkRemaining -= amt;
@@ -63,17 +63,17 @@ nsHttpChunkedDecoder::HandleChunkedConte
             count -= bytesConsumed;
 
             if (count) {
                 // shift buf by bytesConsumed
                 memmove(buf, buf + bytesConsumed, count);
             }
         }
     }
-    
+
     *contentRemaining = count;
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpChunkedDecoder <private>
 //-----------------------------------------------------------------------------
 
@@ -81,17 +81,17 @@ nsresult
 nsHttpChunkedDecoder::ParseChunkRemaining(char *buf,
                                           uint32_t count,
                                           uint32_t *bytesConsumed)
 {
     NS_PRECONDITION(mChunkRemaining == 0, "chunk remaining should be zero");
     NS_PRECONDITION(count, "unexpected");
 
     *bytesConsumed = 0;
-    
+
     char *p = static_cast<char *>(memchr(buf, '\n', count));
     if (p) {
         *p = 0;
         if ((p > buf) && (*(p-1) == '\r')) // eliminate a preceding CR
             *(p-1) = 0;
         *bytesConsumed = p - buf + 1;
 
         // make buf point to the full line buffer to parse
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -205,17 +205,17 @@ nsHttpConnection::StartSpdy(uint8_t spdy
         if (!count) {
             mTransaction->Close(NS_ERROR_ABORT);
             return;
         }
 
         for (int32_t index = 0; index < count; ++index) {
             if (!mSpdySession) {
                 mSpdySession = ASpdySession::NewSpdySession(spdyVersion,
-                                                            list[index], mSocketTransport, 
+                                                            list[index], mSocketTransport,
                                                             mPriority);
             }
             else {
                 // AddStream() cannot fail
                 if (!mSpdySession->AddStream(list[index], mPriority)) {
                     MOZ_ASSERT(false, "SpdySession::AddStream failed");
                     LOG(("SpdySession::AddStream failed\n"));
                     mTransaction->Close(NS_ERROR_ABORT);
@@ -242,34 +242,34 @@ nsHttpConnection::EnsureNPNComplete()
     if (!mSocketTransport) {
         // this cannot happen
         mNPNComplete = true;
         return true;
     }
 
     if (mNPNComplete)
         return true;
-    
+
     nsresult rv;
 
     nsCOMPtr<nsISupports> securityInfo;
     nsCOMPtr<nsISSLSocketControl> ssl;
     nsAutoCString negotiatedNPN;
-    
+
     rv = mSocketTransport->GetSecurityInfo(getter_AddRefs(securityInfo));
     if (NS_FAILED(rv))
         goto npnComplete;
 
     ssl = do_QueryInterface(securityInfo, &rv);
     if (NS_FAILED(rv))
         goto npnComplete;
 
     rv = ssl->GetNegotiatedNPN(negotiatedNPN);
     if (rv == NS_ERROR_NOT_CONNECTED) {
-    
+
         // By writing 0 bytes to the socket the SSL handshake machine is
         // pushed forward.
         uint32_t count = 0;
         rv = mSocketOut->Write("", 0, &count);
 
         if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK)
             goto npnComplete;
         return false;
@@ -342,17 +342,17 @@ nsHttpConnection::Activate(nsAHttpTransa
 
     // Clear the per activation counter
     mCurrentBytesRead = 0;
 
     // The overflow state is not needed between activations
     mInputOverflow = nullptr;
 
     rv = OnOutputStreamReady(mSocketOut);
-    
+
 failed_activation:
     if (NS_FAILED(rv)) {
         mTransaction = nullptr;
     }
 
     return rv;
 }
 
@@ -439,17 +439,17 @@ nsHttpConnection::AddTransaction(nsAHttp
 {
     LOG(("nsHttpConnection::AddTransaction for SPDY"));
 
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     MOZ_ASSERT(mSpdySession && mUsingSpdyVersion,
                "AddTransaction to live http connection without spdy");
     MOZ_ASSERT(mTransaction,
                "AddTransaction to idle http connection");
-    
+
     if (!mSpdySession->AddStream(httpTransaction, priority)) {
         MOZ_ASSERT(false, "AddStream should never fail due to"
                    "RoomForMore() admission check");
         return NS_ERROR_FAILURE;
     }
 
     ResumeSend();
 
@@ -482,17 +482,17 @@ nsHttpConnection::Close(nsresult reason)
                 do {
                     rv = mSocketIn->Read(buffer, 4000, &count);
                     if (NS_SUCCEEDED(rv))
                         total += count;
                 }
                 while (NS_SUCCEEDED(rv) && count > 0 && total < 64000);
                 LOG(("nsHttpConnection::Close drained %d bytes\n", total));
             }
-            
+
             mSocketTransport->SetSecurityCallbacks(nullptr);
             mSocketTransport->Close(reason);
             if (mSocketOut)
                 mSocketOut->AsyncWait(nullptr, 0, 0, nullptr);
         }
         mKeepAlive = false;
     }
 }
@@ -546,17 +546,17 @@ nsHttpConnection::CanReuse()
         return false;
 
     if ((mTransaction ? mTransaction->PipelineDepth() : 0) >=
         mRemainingConnectionUses) {
         return false;
     }
 
     bool canReuse;
-    
+
     if (mSpdySession)
         canReuse = mSpdySession->CanReuse();
     else
         canReuse = IsKeepAlive();
 
     canReuse = canReuse && (IdleTime() < mIdleTimeout) && IsAlive();
 
     // An idle persistent connection should not have data waiting to be read
@@ -576,17 +576,17 @@ nsHttpConnection::CanReuse()
 }
 
 bool
 nsHttpConnection::CanDirectlyActivate()
 {
     // return true if a new transaction can be addded to ths connection at any
     // time through Activate(). In practice this means this is a healthy SPDY
     // connection with room for more concurrent streams.
-    
+
     return UsingSpdy() && CanReuse() &&
         mSpdySession && mSpdySession->RoomForMoreStreams();
 }
 
 PRIntervalTime
 nsHttpConnection::IdleTime()
 {
     return mSpdySession ?
@@ -653,32 +653,32 @@ nsHttpConnection::SupportsPipelining(nsH
 
     // If there is no server header we will assume it should not be banned
     // as facebook and some other prominent sites do this
     if (!val)
         return true;
 
     // The blacklist is indexed by the first character. All of these servers are
     // known to return their identifier as the first thing in the server string,
-    // so we can do a leading match. 
+    // so we can do a leading match.
 
     static const char *bad_servers[26][6] = {
         { nullptr }, { nullptr }, { nullptr }, { nullptr },                 // a - d
         { "EFAServer/", nullptr },                                       // e
         { nullptr }, { nullptr }, { nullptr }, { nullptr },                 // f - i
-        { nullptr }, { nullptr }, { nullptr },                             // j - l 
+        { nullptr }, { nullptr }, { nullptr },                             // j - l
         { "Microsoft-IIS/4.", "Microsoft-IIS/5.", nullptr },             // m
-        { "Netscape-Enterprise/3.", "Netscape-Enterprise/4.", 
+        { "Netscape-Enterprise/3.", "Netscape-Enterprise/4.",
           "Netscape-Enterprise/5.", "Netscape-Enterprise/6.", nullptr }, // n
         { nullptr }, { nullptr }, { nullptr }, { nullptr },                 // o - r
         { nullptr }, { nullptr }, { nullptr }, { nullptr },                 // s - v
         { "WebLogic 3.", "WebLogic 4.","WebLogic 5.", "WebLogic 6.",
-          "Winstone Servlet Engine v0.", nullptr },                      // w 
+          "Winstone Servlet Engine v0.", nullptr },                      // w
         { nullptr }, { nullptr }, { nullptr }                              // x - z
-    };  
+    };
 
     int index = val[0] - 'A'; // the whole table begins with capital letters
     if ((index >= 0) && (index <= 25))
     {
         for (int i = 0; bad_servers[index][i] != nullptr; i++) {
             if (!PL_strncmp (val, bad_servers[index][i], strlen (bad_servers[index][i]))) {
                 LOG(("looks like this server does not support pipelining"));
                 gHttpHandler->ConnMgr()->PipelineFeedbackInfo(
@@ -739,17 +739,17 @@ nsHttpConnection::OnHeadersAvailable(nsA
 
     if ((responseHead->Version() < NS_HTTP_VERSION_1_1) ||
         (requestHead->Version() < NS_HTTP_VERSION_1_1)) {
         // HTTP/1.0 connections are by default NOT persistent
         if (explicitKeepAlive)
             mKeepAlive = true;
         else
             mKeepAlive = false;
-        
+
         // We need at least version 1.1 to use pipelines
         gHttpHandler->ConnMgr()->PipelineFeedbackInfo(
             mConnInfo, nsHttpConnectionMgr::RedVersionTooLow, this, 0);
     }
     else {
         // HTTP/1.1 connections are by default persistent
         if (explicitClose) {
             mKeepAlive = false;
@@ -794,23 +794,23 @@ nsHttpConnection::OnHeadersAvailable(nsA
     // If this connection is reserved for revalidations and we are
     // receiving a document that failed revalidation then switch the
     // classification to general to avoid pipelining more revalidations behind
     // it.
     if (mClassification == nsAHttpTransaction::CLASS_REVALIDATION &&
         responseStatus != 304) {
         mClassification = nsAHttpTransaction::CLASS_GENERAL;
     }
-    
+
     // if this connection is persistent, then the server may send a "Keep-Alive"
     // header specifying the maximum number of times the connection can be
     // reused as well as the maximum amount of time the connection can be idle
     // before the server will close it.  we ignore the max reuse count, because
     // a "keep-alive" connection is by definition capable of being reused, and
-    // we only care about being able to reuse it once.  if a timeout is not 
+    // we only care about being able to reuse it once.  if a timeout is not
     // specified then we use our advertized timeout value.
     bool foundKeepAliveMax = false;
     if (mKeepAlive) {
         const char *val = responseHead->PeekHeader(nsHttp::Keep_Alive);
 
         if (!mUsingSpdyVersion) {
             const char *cp = PL_strcasestr(val, "timeout=");
             if (cp)
@@ -825,17 +825,17 @@ nsHttpConnection::OnHeadersAvailable(nsA
                     foundKeepAliveMax = true;
                     mRemainingConnectionUses = static_cast<uint32_t>(val);
                 }
             }
         }
         else {
             mIdleTimeout = gHttpHandler->SpdyTimeout();
         }
-        
+
         LOG(("Connection can be reused [this=%p idle-timeout=%usec]\n",
              this, PR_IntervalToSeconds(mIdleTimeout)));
     }
 
     if (!foundKeepAliveMax && mRemainingConnectionUses && !mUsingSpdyVersion)
         --mRemainingConnectionUses;
 
     if (!mProxyConnectStream)
@@ -866,25 +866,25 @@ nsHttpConnection::OnHeadersAvailable(nsA
             MOZ_ASSERT(NS_SUCCEEDED(rv), "mSocketOut->AsyncWait failed");
         }
         else {
             LOG(("proxy CONNECT failed! ssl=%s\n",
                  mConnInfo->UsingSSL() ? "true" :"false"));
             mTransaction->SetProxyConnectFailed();
         }
     }
-    
+
     const char *upgradeReq = requestHead->PeekHeader(nsHttp::Upgrade);
     // Don't use persistent connection for Upgrade unless there's an auth failure:
     // some proxies expect to see auth response on persistent connection.
     if (upgradeReq && responseStatus != 401 && responseStatus != 407) {
         LOG(("HTTP Upgrade in play - disable keepalive\n"));
         DontReuse();
     }
-    
+
     if (responseStatus == 101) {
         const char *upgradeResp = responseHead->PeekHeader(nsHttp::Upgrade);
         if (!upgradeReq || !upgradeResp ||
             !nsHttp::FindToken(upgradeResp, upgradeReq,
                                HTTP_HEADER_VALUE_SEPS)) {
             LOG(("HTTP 101 Upgrade header mismatch req = %s, resp = %s\n",
                  upgradeReq, upgradeResp));
             Close(NS_ERROR_ABORT);
@@ -899,17 +899,17 @@ nsHttpConnection::OnHeadersAvailable(nsA
 
 bool
 nsHttpConnection::IsReused()
 {
     if (mIsReused)
         return true;
     if (!mConsiderReusedAfterInterval)
         return false;
-    
+
     // ReusedAfter allows a socket to be consider reused only after a certain
     // interval of time has passed
     return (PR_IntervalNow() - mConsiderReusedAfterEpoch) >=
         mConsiderReusedAfterInterval;
 }
 
 void
 nsHttpConnection::SetIsReusedAfter(uint32_t afterMilliseconds)
@@ -937,17 +937,17 @@ nsHttpConnection::TakeTransport(nsISocke
     NS_IF_ADDREF(*aInputStream = mSocketIn);
     NS_IF_ADDREF(*aOutputStream = mSocketOut);
 
     mSocketTransport->SetSecurityCallbacks(nullptr);
     mSocketTransport->SetEventSink(nullptr, nullptr);
     mSocketTransport = nullptr;
     mSocketIn = nullptr;
     mSocketOut = nullptr;
-    
+
     return NS_OK;
 }
 
 void
 nsHttpConnection::ReadTimeoutTick(PRIntervalTime now)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
@@ -955,17 +955,17 @@ nsHttpConnection::ReadTimeoutTick(PRInte
     if (!mTransaction)
         return;
 
     // Spdy implements some timeout handling using the SPDY ping frame.
     if (mSpdySession) {
         mSpdySession->ReadTimeoutTick(now);
         return;
     }
-    
+
     if (!gHttpHandler->GetPipelineRescheduleOnTimeout())
         return;
 
     PRIntervalTime delta = now - mLastReadTime;
 
     // we replicate some of the checks both here and in OnSocketReadable() as
     // they will be discovered under different conditions. The ones here
     // will generally be discovered if we are totally hung and OSR does
@@ -997,17 +997,17 @@ nsHttpConnection::ReadTimeoutTick(PRInte
         }
     }
 
     if (delta < gHttpHandler->GetPipelineTimeout())
         return;
 
     if (pipelineDepth <= 1 && !mTransaction->PipelinePosition())
         return;
-    
+
     // nothing has transpired on this pipelined socket for many
     // seconds. Call that a total stall and close the transaction.
     // There is a chance the transaction will be restarted again
     // depending on its state.. that will come back araound
     // without pipelining on, so this won't loop.
 
     LOG(("canceling transaction stalled for %ums on a pipeline "
          "of depth %d and scheduled originally at pos %d\n",
@@ -1044,17 +1044,17 @@ nsresult
 nsHttpConnection::PushBack(const char *data, uint32_t length)
 {
     LOG(("nsHttpConnection::PushBack [this=%p, length=%d]\n", this, length));
 
     if (mInputOverflow) {
         NS_ERROR("nsHttpConnection::PushBack only one buffer supported");
         return NS_ERROR_UNEXPECTED;
     }
-    
+
     mInputOverflow = new nsPreloadedStream(mSocketIn, data, length);
     return NS_OK;
 }
 
 nsresult
 nsHttpConnection::ResumeSend()
 {
     LOG(("nsHttpConnection::ResumeSend [this=%p]\n", this));
@@ -1278,17 +1278,17 @@ nsHttpConnection::OnSocketWritable()
             else
                 rv = mSocketOutCondition;
             again = false;
         }
         else if (n == 0) {
             rv = NS_OK;
 
             if (mTransaction) { // in case the ReadSegments stack called CloseTransaction()
-                // 
+                //
                 // at this point we've written out the entire transaction, and now we
                 // must wait for the server's response.  we manufacture a status message
                 // here to reflect the fact that we are waiting.  this message will be
                 // trumped (overwritten) if the server responds quickly.
                 //
                 mTransaction->OnTransportStatus(mSocketTransport,
                                                 NS_NET_STATUS_WAITING_FOR,
                                                 0);
@@ -1342,17 +1342,17 @@ nsHttpConnection::OnSocketReadable()
         mKeepAliveMask = false;
         gHttpHandler->ProcessPendingQ(mConnInfo);
     }
 
     // Look for data being sent in bursts with large pauses. If the pauses
     // are caused by server bottlenecks such as think-time, disk i/o, or
     // cpu exhaustion (as opposed to network latency) then we generate negative
     // pipelining feedback to prevent head of line problems
-    
+
     // Reduce the estimate of the time since last read by up to 1 RTT to
     // accommodate exhausted sender TCP congestion windows or minor I/O delays.
 
     if (delta > mRtt)
         delta -= mRtt;
     else
         delta = 0;
 
--- a/netwerk/protocol/http/nsHttpConnection.h
+++ b/netwerk/protocol/http/nsHttpConnection.h
@@ -50,17 +50,17 @@ public:
     NS_DECL_NSIINTERFACEREQUESTOR
 
     nsHttpConnection();
     virtual ~nsHttpConnection();
 
     // Initialize the connection:
     //  info        - specifies the connection parameters.
     //  maxHangTime - limits the amount of time this connection can spend on a
-    //                single transaction before it should no longer be kept 
+    //                single transaction before it should no longer be kept
     //                alive.  a value of 0xffff indicates no limit.
     nsresult Init(nsHttpConnectionInfo *info, uint16_t maxHangTime,
                   nsISocketTransport *, nsIAsyncInputStream *,
                   nsIAsyncOutputStream *, nsIInterfaceRequestor *,
                   PRIntervalTime);
 
     // Activate causes the given transaction to be processed on this
     // connection.  It fails if there is already an existing transaction unless
@@ -118,17 +118,17 @@ public:
     nsresult PushBack(const char *data, uint32_t length);
     nsresult ResumeSend();
     nsresult ResumeRecv();
     int64_t  MaxBytesRead() {return mMaxBytesRead;}
 
     static NS_METHOD ReadFromStream(nsIInputStream *, void *, const char *,
                                     uint32_t, uint32_t, uint32_t *);
 
-    // When a persistent connection is in the connection manager idle 
+    // When a persistent connection is in the connection manager idle
     // connection pool, the nsHttpConnection still reads errors and hangups
     // on the socket so that it can be proactively released if the server
     // initiates a termination. Only call on socket thread.
     void BeginIdleMonitoring();
     void EndIdleMonitoring();
 
     bool UsingSpdy() { return !!mUsingSpdyVersion; }
     bool EverUsedSpdy() { return mEverUsedSpdy; }
@@ -163,17 +163,17 @@ private:
     nsresult OnSocketWritable();
     nsresult OnSocketReadable();
 
     nsresult SetupProxyConnect();
 
     PRIntervalTime IdleTime();
     bool     IsAlive();
     bool     SupportsPipelining(nsHttpResponseHead *);
-    
+
     // Makes certain the SSL handshake is complete and NPN negotiation
     // has had a chance to happen
     bool     EnsureNPNComplete();
     void     SetupNPN(uint32_t caps);
 
     // Inform the connection manager of any SPDY Alternate-Protocol
     // redirections
     void     HandleAlternateProtocol(nsHttpResponseHead *);
--- a/netwerk/protocol/http/nsHttpConnectionInfo.h
+++ b/netwerk/protocol/http/nsHttpConnectionInfo.h
@@ -40,17 +40,17 @@ public:
             if (NS_SUCCEEDED(mProxyInfo->GetResolveFlags(&resolveFlags)) &&
                 resolveFlags & nsIProtocolProxyService::RESOLVE_ALWAYS_TUNNEL) {
                 mUsingConnect = true;
             }
         }
 
         SetOriginServer(host, port);
     }
-    
+
    ~nsHttpConnectionInfo()
     {
         LOG(("Destroying nsHttpConnectionInfo @%x\n", this));
     }
 
     nsrefcnt AddRef()
     {
         nsrefcnt n = NS_AtomicIncrementRefcnt(mRef);
@@ -70,44 +70,44 @@ public:
     const nsAFlatCString &HashKey() const { return mHashKey; }
 
     void SetOriginServer(const nsACString &host, int32_t port);
 
     void SetOriginServer(const char *host, int32_t port)
     {
         SetOriginServer(nsDependentCString(host), port);
     }
-    
+
     // OK to treat this as an infalible allocation
     nsHttpConnectionInfo* Clone() const;
 
     const char *ProxyHost() const { return mProxyInfo ? mProxyInfo->Host().get() : nullptr; }
     int32_t     ProxyPort() const { return mProxyInfo ? mProxyInfo->Port() : -1; }
     const char *ProxyType() const { return mProxyInfo ? mProxyInfo->Type() : nullptr; }
 
     // Compare this connection info to another...
     // Two connections are 'equal' if they end up talking the same
     // protocol to the same server. This is needed to properly manage
     // persistent connections to proxies
-    // Note that we don't care about transparent proxies - 
+    // Note that we don't care about transparent proxies -
     // it doesn't matter if we're talking via socks or not, since
     // a request will end up at the same host.
     bool Equals(const nsHttpConnectionInfo *info)
     {
         return mHashKey.Equals(info->HashKey());
     }
 
     const char   *Host() const           { return mHost.get(); }
     int32_t       Port() const           { return mPort; }
     nsProxyInfo  *ProxyInfo()            { return mProxyInfo; }
     bool          UsingHttpProxy() const { return mUsingHttpProxy; }
     bool          UsingSSL() const       { return mUsingSSL; }
     bool          UsingConnect() const   { return mUsingConnect; }
     int32_t       DefaultPort() const    { return mUsingSSL ? NS_HTTPS_DEFAULT_PORT : NS_HTTP_DEFAULT_PORT; }
-    void          SetAnonymous(bool anon)         
+    void          SetAnonymous(bool anon)
                                          { mHashKey.SetCharAt(anon ? 'A' : '.', 2); }
     bool          GetAnonymous() const   { return mHashKey.CharAt(2) == 'A'; }
     void          SetPrivate(bool priv)  { mHashKey.SetCharAt(priv ? 'P' : '.', 3); }
     bool          GetPrivate() const     { return mHashKey.CharAt(3) == 'P'; }
 
     const nsCString &GetHost() { return mHost; }
 
     // Returns true for any kind of proxy (http, socks, etc..)
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -363,41 +363,41 @@ nsHttpConnectionMgr::ReclaimConnection(n
     NS_ADDREF(conn);
     nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgReclaimConnection, 0, conn);
     if (NS_FAILED(rv))
         NS_RELEASE(conn);
     return rv;
 }
 
 // A structure used to marshall 2 pointers across the various necessary
-// threads to complete an HTTP upgrade. 
+// threads to complete an HTTP upgrade.
 class nsCompleteUpgradeData
 {
 public:
 nsCompleteUpgradeData(nsAHttpConnection *aConn,
                       nsIHttpUpgradeListener *aListener)
     : mConn(aConn), mUpgradeListener(aListener) {}
-        
+
     nsRefPtr<nsAHttpConnection> mConn;
     nsCOMPtr<nsIHttpUpgradeListener> mUpgradeListener;
 };
 
 nsresult
 nsHttpConnectionMgr::CompleteUpgrade(nsAHttpConnection *aConn,
                                      nsIHttpUpgradeListener *aUpgradeListener)
 {
     nsCompleteUpgradeData *data =
         new nsCompleteUpgradeData(aConn, aUpgradeListener);
     nsresult rv;
     rv = PostEvent(&nsHttpConnectionMgr::OnMsgCompleteUpgrade, 0, data);
     if (NS_FAILED(rv))
         delete data;
     return rv;
 }
-    
+
 nsresult
 nsHttpConnectionMgr::UpdateParam(nsParamName name, uint16_t value)
 {
     uint32_t param = (uint32_t(name) << 16) | uint32_t(value);
     return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateParam, 0,
                      (void *)(uintptr_t) param);
 }
 
@@ -427,17 +427,17 @@ nsHttpConnectionMgr::OnMsgUpdateRequestT
         dont_AddRef(static_cast<EventTokenBucket *>(param));
     gHttpHandler->SetRequestTokenBucket(tokenBucket);
 }
 
 nsresult
 nsHttpConnectionMgr::UpdateRequestTokenBucket(EventTokenBucket *aBucket)
 {
     nsRefPtr<EventTokenBucket> bucket(aBucket);
-    
+
     // Call From main thread when a new EventTokenBucket has been made in order
     // to post the new value to the socket thread.
     nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgUpdateRequestTokenBucket,
                             0, bucket.get());
     if (NS_SUCCEEDED(rv))
         bucket.forget();
     return rv;
 }
@@ -452,17 +452,17 @@ nsHttpConnectionMgr::LookupConnectionEnt
                                            nsHttpConnection *conn,
                                            nsHttpTransaction *trans)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     if (!ci)
         return nullptr;
 
     nsConnectionEntry *ent = mCT.Get(ci->HashKey());
-    
+
     // If there is no sign of coalescing (or it is disabled) then just
     // return the primary hash lookup
     if (!ent || !ent->mUsingSpdy || ent->mCoalescingKey.IsEmpty())
         return ent;
 
     // If there is no preferred coalescing entry for this host (or the
     // preferred entry is the one that matched the mCT hash lookup) then
     // there is only option
@@ -473,20 +473,20 @@ nsHttpConnectionMgr::LookupConnectionEnt
     if (conn) {
         // The connection could be either in preferred or ent. It is most
         // likely the only active connection in preferred - so start with that.
         if (preferred->mActiveConns.Contains(conn))
             return preferred;
         if (preferred->mIdleConns.Contains(conn))
             return preferred;
     }
-    
+
     if (trans && preferred->mPendingQ.Contains(trans))
         return preferred;
-    
+
     // Neither conn nor trans found in preferred, use the default entry
     return ent;
 }
 
 nsresult
 nsHttpConnectionMgr::CloseIdleConnection(nsHttpConnection *conn)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@@ -516,17 +516,17 @@ nsHttpConnectionMgr::CloseIdleConnection
 // connection is then updated to indicate whether or not we want to use
 // spdy with that host and update the preliminary preferred host
 // entries used for de-sharding hostsnames.
 void
 nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection *conn,
                                           bool usingSpdy)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-    
+
     nsConnectionEntry *ent = LookupConnectionEntry(conn->ConnectionInfo(),
                                                    conn, nullptr);
 
     if (!ent)
         return;
 
     ent->mTestedSpdy = true;
 
@@ -547,17 +547,17 @@ nsHttpConnectionMgr::ReportSpdyConnectio
     // lookup. Filtering on that has to be done at the time of use
     // rather than the time of registration (i.e. now).
     nsConnectionEntry *preferred =
         mSpdyPreferredHash.Get(ent->mCoalescingKey);
 
     LOG(("ReportSpdyConnection %s %s ent=%p preferred=%p\n",
          ent->mConnInfo->Host(), ent->mCoalescingKey.get(),
          ent, preferred));
-    
+
     if (!preferred) {
         if (!ent->mCoalescingKey.IsEmpty()) {
             mSpdyPreferredHash.Put(ent->mCoalescingKey, ent);
             ent->mSpdyPreferred = true;
             preferred = ent;
         }
     }
     else if (preferred != ent) {
@@ -670,21 +670,21 @@ nsHttpConnectionMgr::ReportSpdyAlternate
 
     // The Alternate Protocol hash is protected under the monitor because
     // it is read from both the main and the network thread.
     ReentrantMonitorAutoEnter mon(mReentrantMonitor);
 
     // Check to see if this is already present
     if (mAlternateProtocolHash.Contains(hostPortKey))
         return;
-    
+
     if (mAlternateProtocolHash.Count() > 2000)
         mAlternateProtocolHash.EnumerateEntries(&TrimAlternateProtocolHash,
 						this);
-    
+
     mAlternateProtocolHash.PutEntry(hostPortKey);
 }
 
 void
 nsHttpConnectionMgr::RemoveSpdyAlternateProtocol(nsACString &hostPortKey)
 {
     // The Alternate Protocol hash is protected under the monitor because
     // it is read from both the main and the network thread.
@@ -693,17 +693,17 @@ nsHttpConnectionMgr::RemoveSpdyAlternate
     return mAlternateProtocolHash.RemoveEntry(hostPortKey);
 }
 
 PLDHashOperator
 nsHttpConnectionMgr::TrimAlternateProtocolHash(nsCStringHashKey *entry,
                                                void *closure)
 {
     nsHttpConnectionMgr *self = (nsHttpConnectionMgr *) closure;
-    
+
     if (self->mAlternateProtocolHash.Count() > 2000)
         return PL_DHASH_REMOVE;
     return PL_DHASH_STOP;
 }
 
 nsHttpConnectionMgr::nsConnectionEntry *
 nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry)
 {
@@ -717,17 +717,17 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt
 
     // if there is no redirection no cert validation is required
     if (preferred == aOriginalEntry)
         return aOriginalEntry;
 
     // if there is no preferred host or it is no longer using spdy
     // then skip pooling
     if (!preferred || !preferred->mUsingSpdy)
-        return nullptr;                         
+        return nullptr;
 
     // if there is not an active spdy session in this entry then
     // we cannot pool because the cert upon activation may not
     // be the same as the old one. Active sessions are prohibited
     // from changing certs.
 
     nsHttpConnection *activeSpdy = nullptr;
 
@@ -753,17 +753,17 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt
 
     // Check that the server cert supports redirection
     nsresult rv;
     bool isJoined = false;
 
     nsCOMPtr<nsISupports> securityInfo;
     nsCOMPtr<nsISSLSocketControl> sslSocketControl;
     nsAutoCString negotiatedNPN;
-    
+
     activeSpdy->GetSecurityInfo(getter_AddRefs(securityInfo));
     if (!securityInfo) {
         NS_WARNING("cannot obtain spdy security info");
         return nullptr;
     }
 
     sslSocketControl = do_QueryInterface(securityInfo, &rv);
     if (NS_FAILED(rv)) {
@@ -808,17 +808,17 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt
     return preferred;
 }
 
 void
 nsHttpConnectionMgr::RemoveSpdyPreferredEnt(nsACString &aHashKey)
 {
     if (aHashKey.IsEmpty())
         return;
-    
+
     mSpdyPreferredHash.Remove(aHashKey);
 }
 
 //-----------------------------------------------------------------------------
 // enumeration callbacks
 
 PLDHashOperator
 nsHttpConnectionMgr::ProcessOneTransactionCB(const nsACString &key,
@@ -931,17 +931,17 @@ nsHttpConnectionMgr::PruneDeadConnection
                 }
                 else {
                     timeToNextExpire = std::min(timeToNextExpire,
                                               conn->TimeToLive());
                 }
             }
         }
     }
-    
+
     // If time to next expire found is shorter than time to next wake-up, we need to
     // change the time for next wake-up.
     if (timeToNextExpire != UINT32_MAX) {
         uint32_t now = NowInSeconds();
         uint64_t timeOfNextExpire = now + timeToNextExpire;
         // If pruning of dead connections is not already scheduled to happen
         // or time found for next connection to expire is is before
         // mTimeOfNextWakeUp, we need to schedule the pruning to happen
@@ -1121,21 +1121,21 @@ public:
                            nsHttpConnectionMgr::PipelineFeedbackInfoType info,
                            nsHttpConnection *conn, uint32_t data)
         : mConnInfo(ci)
         , mConn(conn)
         , mInfo(info)
         , mData(data)
         {
         }
-    
+
     ~nsHttpPipelineFeedback()
     {
     }
-    
+
     nsRefPtr<nsHttpConnectionInfo> mConnInfo;
     nsRefPtr<nsHttpConnection> mConn;
     nsHttpConnectionMgr::PipelineFeedbackInfoType mInfo;
     uint32_t mData;
 };
 
 void
 nsHttpConnectionMgr::PipelineFeedbackInfo(nsHttpConnectionInfo *ci,
@@ -1237,17 +1237,17 @@ nsHttpConnectionMgr::AtActiveConnectionL
     if (mNumActiveConns >= mMaxConns) {
         LOG(("  num active conns == max conns\n"));
         return true;
     }
 
     // Add in the in-progress tcp connections, we will assume they are
     // keepalive enabled.
     // Exclude half-open's that has already created a usable connection.
-    // This prevents the limit being stuck on ipv6 connections that 
+    // This prevents the limit being stuck on ipv6 connections that
     // eventually time out after typical 21 seconds of no ACK+SYN reply.
     uint32_t totalCount =
         ent->mActiveConns.Length() + ent->UnconnectedHalfOpens();
 
     uint16_t maxPersistConns;
 
     if (ci->UsingHttpProxy() && !ci->UsingConnect())
         maxPersistConns = mMaxPersistConnsPerProxy;
@@ -1269,17 +1269,17 @@ nsHttpConnectionMgr::ClosePersistentConn
          ent->mConnInfo->HashKey().get()));
     while (ent->mIdleConns.Length()) {
         nsHttpConnection *conn = ent->mIdleConns[0];
         ent->mIdleConns.RemoveElementAt(0);
         mNumIdleConns--;
         conn->Close(NS_ERROR_ABORT);
         NS_RELEASE(conn);
     }
-    
+
     int32_t activeCount = ent->mActiveConns.Length();
     for (int32_t i=0; i < activeCount; i++)
         ent->mActiveConns[i]->DontReuse();
 }
 
 PLDHashOperator
 nsHttpConnectionMgr::ClosePersistentConnectionsCB(const nsACString &key,
                                                   nsAutoPtr<nsConnectionEntry> &ent,
@@ -1293,26 +1293,26 @@ nsHttpConnectionMgr::ClosePersistentConn
 bool
 nsHttpConnectionMgr::RestrictConnections(nsConnectionEntry *ent)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
     // If this host is trying to negotiate a SPDY session right now,
     // don't create any new ssl connections until the result of the
     // negotiation is known.
-    
+
     bool doRestrict = ent->mConnInfo->UsingSSL() &&
         gHttpHandler->IsSpdyEnabled() &&
         (!ent->mTestedSpdy || ent->mUsingSpdy) &&
         (ent->mHalfOpens.Length() || ent->mActiveConns.Length());
 
     // If there are no restrictions, we are done
     if (!doRestrict)
         return false;
-    
+
     // If the restriction is based on a tcp handshake in progress
     // let that connect and then see if it was SPDY or not
     if (ent->UnconnectedHalfOpens())
         return true;
 
     // There is a concern that a host is using a mix of HTTP/1 and SPDY.
     // In that case we don't want to restrict connections just because
     // there is a single active HTTP/1 session in use.
@@ -1340,17 +1340,17 @@ nsHttpConnectionMgr::RestrictConnections
 // returns other NS_ERROR on hard failure conditions
 nsresult
 nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
                                        nsHttpTransaction *trans)
 {
     LOG(("nsHttpConnectionMgr::MakeNewConnection %p ent=%p trans=%p",
          this, ent, trans));
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-        
+
     uint32_t halfOpenLength = ent->mHalfOpens.Length();
     for (uint32_t i = 0; i < halfOpenLength; i++) {
         if (ent->mHalfOpens[i]->IsSpeculative()) {
             // We've found a speculative connection in the half
             // open list. Remove the speculative bit from it and that
             // connection can later be used for this transaction
             // (or another one in the pending queue) - we don't
             // need to open a new connection here.
@@ -1411,17 +1411,17 @@ nsHttpConnectionMgr::AddToShortestPipeli
     if (classification == nsAHttpTransaction::CLASS_SOLO)
         return false;
 
     uint32_t maxdepth = ent->MaxPipelineDepth(classification);
     if (maxdepth == 0) {
         ent->CreditPenalty();
         maxdepth = ent->MaxPipelineDepth(classification);
     }
-    
+
     if (ent->PipelineState() == PS_RED)
         return false;
 
     if (ent->PipelineState() == PS_YELLOW && ent->mYellowConnection)
         return false;
 
     // The maximum depth of a pipeline in yellow is 1 pipeline of
     // depth 2 for entire CI. When that transaction completes successfully
@@ -1499,45 +1499,45 @@ nsHttpConnectionMgr::AddToShortestPipeli
     }
     return true;
 }
 
 bool
 nsHttpConnectionMgr::IsUnderPressure(nsConnectionEntry *ent,
                                    nsHttpTransaction::Classifier classification)
 {
-    // A connection entry is declared to be "under pressure" if most of the 
+    // A connection entry is declared to be "under pressure" if most of the
     // allowed parallel connections are already used up. In that case we want to
     // favor existing pipelines over more parallelism so as to reserve any
     // unused parallel connections for types that don't have existing pipelines.
     //
     // The definition of connection pressure is a pretty liberal one here - that
     // is why we are using the more restrictive maxPersist* counters.
     //
     // Pipelines are also favored when the requested classification is already
     // using 3 or more of the connections. Failure to do this could result in
     // one class (e.g. images) establishing self replenishing queues on all the
     // connections that would starve the other transaction types.
-    
+
     int32_t currentConns = ent->mActiveConns.Length();
     int32_t maxConns =
         (ent->mConnInfo->UsingHttpProxy() && !ent->mConnInfo->UsingConnect()) ?
         mMaxPersistConnsPerProxy : mMaxPersistConnsPerHost;
 
     // Leave room for at least 3 distinct types to operate concurrently,
     // this satisfies the typical {html, js/css, img} page.
     if (currentConns >= (maxConns - 2))
         return true;                           /* prefer pipeline */
 
     int32_t sameClass = 0;
     for (int32_t i = 0; i < currentConns; ++i)
         if (classification == ent->mActiveConns[i]->Classification())
             if (++sameClass == 3)
                 return true;                   /* prefer pipeline */
-    
+
     return false;                              /* normal behavior */
 }
 
 // returns OK if a connection is found for the transaction
 //   and the transaction is started.
 // returns ERROR_NOT_AVAILABLE if no connection can be found and it
 //   should be queued until circumstances change
 // returns other ERROR when transaction has a hard failure and should
@@ -1646,17 +1646,17 @@ nsHttpConnectionMgr::TryDispatchTransact
     if (caps & NS_HTTP_ALLOW_KEEPALIVE) {
         nsRefPtr<nsHttpConnection> conn;
         while (!conn && (ent->mIdleConns.Length() > 0)) {
             conn = ent->mIdleConns[0];
             ent->mIdleConns.RemoveElementAt(0);
             mNumIdleConns--;
             nsHttpConnection *temp = conn;
             NS_RELEASE(temp);
-            
+
             // we check if the connection can be reused before even checking if
             // it is a "matching" connection.
             if (!conn->CanReuse()) {
                 LOG(("   dropping stale connection: [conn=%x]\n", conn.get()));
                 conn->Close(NS_ERROR_ABORT);
                 conn = nullptr;
             }
             else {
@@ -1692,33 +1692,33 @@ nsHttpConnectionMgr::TryDispatchTransact
 
     // step 4
     if (!onlyReusedConnection) {
         nsresult rv = MakeNewConnection(ent, trans);
         if (NS_SUCCEEDED(rv)) {
             // this function returns NOT_AVAILABLE for asynchronous connects
             return NS_ERROR_NOT_AVAILABLE;
         }
-        
+
         if (rv != NS_ERROR_NOT_AVAILABLE) {
             // not available return codes should try next step as they are
             // not hard errors. Other codes should stop now
             return rv;
         }
     }
-    
+
     // step 5
     if (caps & NS_HTTP_ALLOW_PIPELINING) {
         if (AddToShortestPipeline(ent, trans,
                                   classification,
                                   mMaxPipelinedRequests)) {
             return NS_OK;
         }
     }
-    
+
     // step 6
     return NS_ERROR_NOT_AVAILABLE;                /* queue it */
 }
 
 nsresult
 nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent,
                                          nsHttpTransaction *trans,
                                          nsHttpConnection *conn)
@@ -1831,17 +1831,17 @@ nsHttpConnectionMgr::DispatchAbstractTra
         transaction->SetConnection(nullptr);
         NS_RELEASE(handle->mConn);
         // destroy the connection
         NS_RELEASE(conn);
     }
 
     // As transaction goes out of scope it will drop the last refernece to the
     // pipeline if activation failed, in which case this will destroy
-    // the pipeline, which will cause each the transactions owned by the 
+    // the pipeline, which will cause each the transactions owned by the
     // pipeline to be restarted.
 
     return rv;
 }
 
 nsresult
 nsHttpConnectionMgr::BuildPipeline(nsConnectionEntry *ent,
                                    nsAHttpTransaction *firstTrans,
@@ -1849,17 +1849,17 @@ nsHttpConnectionMgr::BuildPipeline(nsCon
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
     /* form a pipeline here even if nothing is pending so that we
        can stream-feed it as new transactions arrive */
 
     /* the first transaction can go in unconditionally - 1 transaction
        on a nsHttpPipeline object is not a real HTTP pipeline */
-   
+
     nsRefPtr<nsHttpPipeline> pipeline = new nsHttpPipeline();
     pipeline->AddTransaction(firstTrans);
     NS_ADDREF(*result = pipeline);
     return NS_OK;
 }
 
 void
 nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent)
@@ -1927,17 +1927,17 @@ nsHttpConnectionMgr::ProcessNewTransacti
     }
     else
         rv = TryDispatchTransaction(ent, false, trans);
 
     if (NS_SUCCEEDED(rv)) {
         LOG(("  ProcessNewTransaction Dispatch Immediately trans=%p\n", trans));
         return rv;
     }
-    
+
     if (rv == NS_ERROR_NOT_AVAILABLE) {
         LOG(("  adding transaction to pending queue "
              "[trans=%p pending-count=%u]\n",
              trans, ent->mPendingQ.Length()+1));
         // put this transaction on the pending queue...
         InsertTransactionSorted(ent->mPendingQ, trans);
         NS_ADDREF(trans);
         return NS_OK;
@@ -1982,17 +1982,17 @@ nsHttpConnectionMgr::RecvdConnect()
 
 nsresult
 nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
                                      nsAHttpTransaction *trans,
                                      uint32_t caps,
                                      bool speculative)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-    
+
     nsRefPtr<nsHalfOpenSocket> sock = new nsHalfOpenSocket(ent, trans, caps);
     nsresult rv = sock->SetupPrimaryStreams();
     NS_ENSURE_SUCCESS(rv, rv);
 
     ent->mHalfOpens.AppendElement(sock);
     mNumHalfOpenConns++;
     if (speculative)
         sock->SetSpeculative(true);
@@ -2015,17 +2015,17 @@ nsHttpConnectionMgr::ProcessSpdyPendingQ
     for (int32_t index = ent->mPendingQ.Length() - 1;
          index >= 0 && conn->CanDirectlyActivate();
          --index) {
         nsHttpTransaction *trans = ent->mPendingQ[index];
 
         if (!(trans->Caps() & NS_HTTP_ALLOW_KEEPALIVE) ||
             trans->Caps() & NS_HTTP_DISALLOW_SPDY)
             continue;
- 
+
         ent->mPendingQ.RemoveElementAt(index);
 
         nsresult rv = DispatchTransaction(ent, trans, conn);
         if (NS_FAILED(rv)) {
             // this cannot happen, but if due to some bug it does then
             // close the transaction
             MOZ_ASSERT(false, "Dispatch SPDY Transaction");
             LOG(("ProcessSpdyPendingQ Dispatch Transaction failed trans=%p\n",
@@ -2063,30 +2063,30 @@ nsHttpConnectionMgr::GetSpdyPreferredCon
     nsConnectionEntry *preferred = GetSpdyPreferredEnt(ent);
 
     // this entry is spdy-enabled if it is involved in a redirect
     if (preferred)
         // all new connections for this entry will use spdy too
         ent->mUsingSpdy = true;
     else
         preferred = ent;
-    
+
     nsHttpConnection *conn = nullptr;
-    
+
     if (preferred->mUsingSpdy) {
         for (uint32_t index = 0;
              index < preferred->mActiveConns.Length();
              ++index) {
             if (preferred->mActiveConns[index]->CanDirectlyActivate()) {
                 conn = preferred->mActiveConns[index];
                 break;
             }
         }
     }
-    
+
     return conn;
 }
 
 //-----------------------------------------------------------------------------
 
 void
 nsHttpConnectionMgr::OnMsgShutdown(int32_t, void *param)
 {
@@ -2095,19 +2095,19 @@ nsHttpConnectionMgr::OnMsgShutdown(int32
 
     mCT.Enumerate(ShutdownPassCB, this);
 
     if (mTimeoutTick) {
         mTimeoutTick->Cancel();
         mTimeoutTick = nullptr;
         mTimeoutTickArmed = false;
     }
-    
+
     // signal shutdown complete
-    nsRefPtr<nsIRunnable> runnable = 
+    nsRefPtr<nsIRunnable> runnable =
         new nsConnEvent(this, &nsHttpConnectionMgr::OnMsgShutdownConfirm,
                         0, param);
     NS_DispatchToMainThread(runnable);
 }
 
 void
 nsHttpConnectionMgr::OnMsgShutdownConfirm(int32_t priority, void *param)
 {
@@ -2246,17 +2246,17 @@ nsHttpConnectionMgr::OnMsgDoShiftReloadC
 void
 nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, void *param)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     LOG(("nsHttpConnectionMgr::OnMsgReclaimConnection [conn=%p]\n", param));
 
     nsHttpConnection *conn = (nsHttpConnection *) param;
 
-    // 
+    //
     // 1) remove the connection from the active list
     // 2) if keep-alive, add connection to idle list
     // 3) post event to process the pending transaction queue
     //
 
     nsConnectionEntry *ent = LookupConnectionEntry(conn->ConnectionInfo(),
                                                    conn, nullptr);
     nsHttpConnectionInfo *ci = nullptr;
@@ -2322,17 +2322,17 @@ nsHttpConnectionMgr::OnMsgReclaimConnect
             if(!mTimer || NowInSeconds() + timeToLive < mTimeOfNextWakeUp)
                 PruneDeadConnectionsAfter(timeToLive);
         }
         else {
             LOG(("  connection cannot be reused; closing connection\n"));
             conn->Close(NS_ERROR_ABORT);
         }
     }
- 
+
     OnMsgProcessPendingQ(0, ci); // releases |ci|
     NS_RELEASE(conn);
 }
 
 void
 nsHttpConnectionMgr::OnMsgCompleteUpgrade(int32_t, void *param)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@@ -2396,17 +2396,17 @@ nsHttpConnectionMgr::nsConnectionEntry::
     NS_RELEASE(mConnInfo);
 }
 
 void
 nsHttpConnectionMgr::OnMsgProcessFeedback(int32_t, void *param)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     nsHttpPipelineFeedback *fb = (nsHttpPipelineFeedback *)param;
-    
+
     PipelineFeedbackInfo(fb->mConnInfo, fb->mInfo, fb->mConn, fb->mData);
     delete fb;
 }
 
 // Read Timeout Tick handlers
 
 void
 nsHttpConnectionMgr::ActivateTimeoutTick()
@@ -2628,17 +2628,17 @@ nsHalfOpenSocket::nsHalfOpenSocket(nsCon
 }
 
 nsHttpConnectionMgr::nsHalfOpenSocket::~nsHalfOpenSocket()
 {
     MOZ_ASSERT(!mStreamOut);
     MOZ_ASSERT(!mBackupStreamOut);
     MOZ_ASSERT(!mSynTimer);
     LOG(("Destroying nsHalfOpenSocket [this=%p]\n", this));
-    
+
     if (mEnt)
         mEnt->RemoveHalfOpen(this);
 }
 
 nsresult
 nsHttpConnectionMgr::
 nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport,
                                nsIAsyncInputStream **instream,
@@ -2659,17 +2659,17 @@ nsHalfOpenSocket::SetupStreams(nsISocket
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = sts->CreateTransport(types, typeCount,
                               nsDependentCString(mEnt->mConnInfo->Host()),
                               mEnt->mConnInfo->Port(),
                               mEnt->mConnInfo->ProxyInfo(),
                               getter_AddRefs(socketTransport));
     NS_ENSURE_SUCCESS(rv, rv);
-    
+
     uint32_t tmpFlags = 0;
     if (mCaps & NS_HTTP_REFRESH_DNS)
         tmpFlags = nsISocketTransport::BYPASS_CACHE;
 
     if (mCaps & NS_HTTP_LOAD_ANONYMOUS)
         tmpFlags |= nsISocketTransport::ANONYMOUS_CONNECT;
 
     if (mEnt->mConnInfo->GetPrivate())
@@ -2765,17 +2765,17 @@ nsHttpConnectionMgr::nsHalfOpenSocket::S
     return rv;
 }
 
 void
 nsHttpConnectionMgr::nsHalfOpenSocket::SetupBackupTimer()
 {
     uint16_t timeout = gHttpHandler->GetIdleSynTimeout();
     MOZ_ASSERT(!mSynTimer, "timer already initd");
-    
+
     if (timeout && !mTransaction->IsDone()) {
         // Setup the timer that will establish a backup socket
         // if we do not get a writable event on the main one.
         // We do this because a lost SYN takes a very long time
         // to repair at the TCP level.
         //
         // Failure to setup the timer is something we can live with,
         // so don't return an error in that case.
@@ -2858,22 +2858,22 @@ nsHttpConnectionMgr::nsHalfOpenSocket::N
 // method for nsIAsyncOutputStreamCallback
 NS_IMETHODIMP
 nsHttpConnectionMgr::
 nsHalfOpenSocket::OnOutputStreamReady(nsIAsyncOutputStream *out)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     MOZ_ASSERT(out == mStreamOut || out == mBackupStreamOut,
                "stream mismatch");
-    LOG(("nsHalfOpenSocket::OnOutputStreamReady [this=%p ent=%s %s]\n", 
+    LOG(("nsHalfOpenSocket::OnOutputStreamReady [this=%p ent=%s %s]\n",
          this, mEnt->mConnInfo->Host(),
          out == mStreamOut ? "primary" : "backup"));
     int32_t index;
     nsresult rv;
-    
+
     gHttpHandler->ConnMgr()->RecvdConnect();
 
     CancelBackupTimer();
 
     // assign the new socket to the http connection
     nsRefPtr<nsHttpConnection> conn = new nsHttpConnection();
     LOG(("nsHalfOpenSocket::OnOutputStreamReady "
          "Created new nshttpconnection %p\n", conn.get()));
@@ -3141,33 +3141,33 @@ nsHttpConnectionMgr::nsConnectionEntry::
     return mPipelineState != nsHttpConnectionMgr::PS_RED;
 }
 
 nsHttpConnectionMgr::PipeliningState
 nsHttpConnectionMgr::nsConnectionEntry::PipelineState()
 {
     return mPipelineState;
 }
-    
+
 void
 nsHttpConnectionMgr::
 nsConnectionEntry::OnPipelineFeedbackInfo(
     nsHttpConnectionMgr::PipelineFeedbackInfoType info,
     nsHttpConnection *conn,
     uint32_t data)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-    
+
     if (mPipelineState == PS_YELLOW) {
         if (info & kPipelineInfoTypeBad)
             mYellowBadEvents++;
         else if (info & (kPipelineInfoTypeNeutral | kPipelineInfoTypeGood))
             mYellowGoodEvents++;
     }
-    
+
     if (mPipelineState == PS_GREEN && info == GoodCompletedOK) {
         int32_t depth = data;
         LOG(("Transaction completed at pipeline depth of %d. Host = %s\n",
              depth, mConnInfo->Host()));
 
         if (depth >= 3)
             mGreenDepth = kPipelineUnlimited;
     }
@@ -3199,17 +3199,17 @@ nsConnectionEntry::OnPipelineFeedbackInf
             mPipeliningPenalty = 0;
         }
 
         if (mLastCreditTime.IsNull())
             mLastCreditTime = TimeStamp::Now();
 
         // Red* events impact the host globally via mPipeliningPenalty, while
         // Bad* events impact the per class penalty.
-        
+
         // The individual penalties should be < 16bit-signed-maxint - 25000
         // (approx 7500). Penalties are paid-off either when something promising
         // happens (a successful transaction, or promising headers) or when
         // time goes by at a rate of 1 penalty point every 16 seconds.
 
         switch (info) {
         case RedVersionTooLow:
             mPipeliningPenalty += 1000;
@@ -3237,22 +3237,22 @@ nsConnectionEntry::OnPipelineFeedbackInf
             break;
         case BadUnexpectedLarge:
             mPipeliningClassPenalty[classification] += 120;
             break;
 
         default:
             MOZ_ASSERT(false, "Unknown Bad/Red Pipeline Feedback Event");
         }
-        
+
         const int16_t kPenalty = 25000;
         mPipeliningPenalty = std::min(mPipeliningPenalty, kPenalty);
         mPipeliningClassPenalty[classification] =
           std::min(mPipeliningClassPenalty[classification], kPenalty);
-            
+
         LOG(("Assessing red penalty to %s class %d for event %d. "
              "Penalty now %d, throttle[%d] = %d\n", mConnInfo->Host(),
              classification, info, mPipeliningPenalty, classification,
              mPipeliningClassPenalty[classification]));
     }
     else {
         // hand out credits for neutral and good events such as
         // "headers look ok" events
@@ -3304,32 +3304,32 @@ nsConnectionEntry::OnYellowComplete()
 }
 
 void
 nsHttpConnectionMgr::
 nsConnectionEntry::CreditPenalty()
 {
     if (mLastCreditTime.IsNull())
         return;
-    
+
     // Decrease penalty values by 1 for every 16 seconds
     // (i.e 3.7 per minute, or 1000 every 4h20m)
 
     TimeStamp now = TimeStamp::Now();
     TimeDuration elapsedTime = now - mLastCreditTime;
     uint32_t creditsEarned =
         static_cast<uint32_t>(elapsedTime.ToSeconds()) >> 4;
-    
+
     bool failed = false;
     if (creditsEarned > 0) {
-        mPipeliningPenalty = 
+        mPipeliningPenalty =
             std::max(int32_t(mPipeliningPenalty - creditsEarned), 0);
         if (mPipeliningPenalty > 0)
             failed = true;
-        
+
         for (int32_t i = 0; i < nsAHttpTransaction::CLASS_MAX; ++i) {
             mPipeliningClassPenalty[i]  =
                 std::max(int32_t(mPipeliningClassPenalty[i] - creditsEarned), 0);
             failed = failed || (mPipeliningClassPenalty[i] > 0);
         }
 
         // update last credit mark to reflect elapsed time
         mLastCreditTime += TimeDuration::FromSeconds(creditsEarned << 4);
@@ -3344,25 +3344,25 @@ nsConnectionEntry::CreditPenalty()
         mLastCreditTime = TimeStamp();    /* reset to null timestamp */
 
     if (mPipelineState == PS_RED && !mPipeliningPenalty)
     {
         LOG(("transition %s to yellow based on time credit\n",
              mConnInfo->Host()));
         mPipelineState = PS_YELLOW;
         mYellowConnection = nullptr;
-    }    
+    }
 }
 
 uint32_t
 nsHttpConnectionMgr::
 nsConnectionEntry::MaxPipelineDepth(nsAHttpTransaction::Classifier aClass)
 {
     // Still subject to configuration limit no matter return value
-    
+
     if ((mPipelineState == PS_RED) || (mPipeliningClassPenalty[aClass] > 0))
         return 0;
 
     if (mPipelineState == PS_YELLOW)
         return kPipelineRestricted;
 
     return mGreenDepth;
 }
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -110,17 +110,17 @@ public:
     // soon. The connection manager may use this information to start a TCP
     // and/or SSL level handshake for that resource immediately so that it is
     // ready when the transaction is submitted. No obligation is taken on by the
     // connection manager, nor is the submitter obligated to actually submit a
     // real transaction for this connectionInfo.
     nsresult SpeculativeConnect(nsHttpConnectionInfo *,
                                 nsIInterfaceRequestor *);
 
-    // called when a connection is done processing a transaction.  if the 
+    // called when a connection is done processing a transaction.  if the
     // connection can be reused then it will be added to the idle list, else
     // it will be closed.
     nsresult ReclaimConnection(nsHttpConnection *conn);
 
     // called by the main thread to execute the taketransport() logic on the
     // socket thread after a 101 response has been received and the socket
     // needs to be transferred to an expectant upgrade listener such as
     // websockets.
@@ -153,17 +153,17 @@ public:
     enum PipelineFeedbackInfoType
     {
         // Used when an HTTP response less than 1.1 is received
         RedVersionTooLow = kPipelineInfoTypeRed | kPipelineInfoTypeBad | 0x0001,
 
         // Used when a HTTP Server response header that is on the banned from
         // pipelining list is received
         RedBannedServer = kPipelineInfoTypeRed | kPipelineInfoTypeBad | 0x0002,
-    
+
         // Used when a response is terminated early, when it fails an
         // integrity check such as assoc-req or when a 304 contained a Last-Modified
         // differnet than the entry being validated.
         RedCorruptedContent = kPipelineInfoTypeRed | kPipelineInfoTypeBad | 0x0004,
 
         // Used when a pipeline is only partly satisfied - for instance if the
         // server closed the connection after responding to the first
         // request but left some requests unprocessed.
@@ -179,29 +179,29 @@ public:
 
         // Used when there is a gap of > 1200ms in between data being
         // read from the server
         BadSlowReadMajor = kPipelineInfoTypeBad | 0x0007,
 
         // Used when a response is received that is not framed with either chunked
         // encoding or a complete content length.
         BadInsufficientFraming = kPipelineInfoTypeBad | 0x0008,
-        
+
         // Used when a very large response is recevied in a potential pipelining
         // context. Large responses cause head of line blocking.
         BadUnexpectedLarge = kPipelineInfoTypeBad | 0x000B,
 
         // Used when a response is received that has headers that appear to support
         // pipelining.
         NeutralExpectedOK = kPipelineInfoTypeNeutral | 0x0009,
 
         // Used when a response is received successfully to a pipelined request.
         GoodCompletedOK = kPipelineInfoTypeGood | 0x000A
     };
-    
+
     // called to provide information relevant to the pipelining manager
     // may be called from any thread
     void     PipelineFeedbackInfo(nsHttpConnectionInfo *,
                                   PipelineFeedbackInfoType info,
                                   nsHttpConnection *,
                                   uint32_t);
 
     void ReportFailedToProcess(nsIURI *uri);
@@ -231,17 +231,17 @@ public:
     // upgraded to SPDY because the dispatch and idle semantics are a little
     // bit different.
     void ReportSpdyConnection(nsHttpConnection *, bool usingSpdy);
 
     // A spdy server can supply cwnd information for the session that is used
     // in future sessions to speed up the opening portions of the connection.
     void ReportSpdyCWNDSetting(nsHttpConnectionInfo *host, uint32_t cwndValue);
     uint32_t GetSpdyCWNDSetting(nsHttpConnectionInfo *host);
-    
+
     bool     SupportsPipelining(nsHttpConnectionInfo *);
 
     bool GetConnectionData(nsTArray<mozilla::net::HttpRetParams> *);
 
     void ResetIPFamilyPreference(nsHttpConnectionInfo *);
 
 private:
     virtual ~nsHttpConnectionMgr();
@@ -257,17 +257,17 @@ private:
         PS_YELLOW,
 
         // One or more bad events has happened that indicate that pipelining
         // to this host (or a particular type of transaction with this host)
         // is a bad idea. Pipelining is not currently allowed, but time and
         // other positive experiences will eventually allow it to try again.
         PS_RED
     };
-    
+
     class nsHalfOpenSocket;
 
     // nsConnectionEntry
     //
     // mCT maps connection info hash key to nsConnectionEntry object, which
     // contains list of active and idle connections as well as the list of
     // pending transactions.
     //
@@ -289,17 +289,17 @@ private:
 
         // Remove a particular half open socket from the mHalfOpens array
         void RemoveHalfOpen(nsHalfOpenSocket *);
 
         // Pipeline depths for various states
         const static uint32_t kPipelineUnlimited  = 1024; // fully open - extended green
         const static uint32_t kPipelineOpen       = 6;    // 6 on each conn - normal green
         const static uint32_t kPipelineRestricted = 2;    // 2 on just 1 conn in yellow
-        
+
         nsHttpConnectionMgr::PipeliningState PipelineState();
         void OnPipelineFeedbackInfo(
             nsHttpConnectionMgr::PipelineFeedbackInfoType info,
             nsHttpConnection *, uint32_t);
         bool SupportsPipelining();
         uint32_t MaxPipelineDepth(nsAHttpTransaction::Classifier classification);
         void CreditPenalty();
 
@@ -417,17 +417,17 @@ private:
         NS_DECL_NSITRANSPORTEVENTSINK
         NS_DECL_NSIINTERFACEREQUESTOR
         NS_DECL_NSITIMERCALLBACK
 
         nsHalfOpenSocket(nsConnectionEntry *ent,
                          nsAHttpTransaction *trans,
                          uint32_t caps);
         ~nsHalfOpenSocket();
-        
+
         nsresult SetupStreams(nsISocketTransport **,
                               nsIAsyncInputStream **,
                               nsIAsyncOutputStream **,
                               bool isBackup);
         nsresult SetupPrimaryStreams();
         nsresult SetupBackupStreams();
         void     SetupBackupTimer();
         void     CancelBackupTimer();
@@ -626,17 +626,17 @@ private:
     // that are accessed from mCT connection table.
     uint16_t mNumIdleConns;
     // Total number of spdy connections which are a subset of the active conns
     uint16_t mNumSpdyActiveConns;
     // Total number of connections in mHalfOpens ConnectionEntry objects
     // that are accessed from mCT connection table
     uint32_t mNumHalfOpenConns;
 
-    // Holds time in seconds for next wake-up to prune dead connections. 
+    // Holds time in seconds for next wake-up to prune dead connections.
     uint64_t mTimeOfNextWakeUp;
     // Timer for next pruning of dead connections.
     nsCOMPtr<nsITimer> mTimer;
 
     // A 1s tick to call nsHttpConnection::ReadTimeoutTick on
     // active http/1 connections and check for orphaned half opens.
     // Disabled when there are no active or half open connections.
     nsCOMPtr<nsITimer> mTimeoutTick;
--- a/netwerk/protocol/http/nsHttpDigestAuth.cpp
+++ b/netwerk/protocol/http/nsHttpDigestAuth.cpp
@@ -95,17 +95,17 @@ nsHttpDigestAuth::GetMethodAndPath(nsIHt
         int32_t port;
         rv = uri->GetAsciiHost(path);
         rv2 = uri->GetPort(&port);
         if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(rv2)) {
           path.Append(':');
           path.AppendInt(port < 0 ? NS_HTTPS_DEFAULT_PORT : port);
         }
       }
-      else { 
+      else {
         rv = authChannel->GetRequestMethod(httpMethod);
         rv2 = uri->GetPath(path);
         if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(rv2)) {
           //
           // strip any fragment identifier from the URL path.
           //
           int32_t ref = path.RFindChar('#');
           if (ref != kNotFound)
@@ -214,17 +214,17 @@ nsHttpDigestAuth::GenerateCredentials(ns
     // we do not support auth-int "quality of protection" currently
     qop &= ~QOP_AUTH_INT;
 
     NS_WARNING("no support for Digest authentication with data integrity quality of protection");
 
     /* TODO: to support auth-int, we need to get an MD5 digest of
      * TODO: the data uploaded with this request.
      * TODO: however, i am not sure how to read in the file in without
-     * TODO: disturbing the channel''s use of it. do i need to copy it 
+     * TODO: disturbing the channel''s use of it. do i need to copy it
      * TODO: somehow?
      */
 #if 0
     if (http_channel != nullptr)
     {
       nsIInputStream * upload;
       nsCOMPtr<nsIUploadChannel> uc = do_QueryInterface(http_channel);
       NS_ENSURE_TRUE(uc, NS_ERROR_UNEXPECTED);
@@ -246,46 +246,46 @@ nsHttpDigestAuth::GenerateCredentials(ns
     // they asked only for algorithms that we do not support
     NS_WARNING("unsupported algorithm requested by Digest authentication");
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   //
   // the following are for increasing security.  see RFC 2617 for more
   // information.
-  // 
+  //
   // nonce_count allows the server to keep track of auth challenges (to help
   // prevent spoofing). we increase this count every time.
   //
   char nonce_count[NONCE_COUNT_LENGTH+1] = "00000001"; // in hex
   if (*sessionState) {
     nsCOMPtr<nsISupportsPRUint32> v(do_QueryInterface(*sessionState));
     if (v) {
       uint32_t nc;
       v->GetData(&nc);
       PR_snprintf(nonce_count, sizeof(nonce_count), "%08x", ++nc);
       v->SetData(nc);
     }
   }
   else {
     nsCOMPtr<nsISupportsPRUint32> v(
             do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID));
-    if (v) {        
+    if (v) {
       v->SetData(1);
       NS_ADDREF(*sessionState = v);
     }
   }
   LOG(("   nonce_count=%s\n", nonce_count));
 
   //
   // this lets the client verify the server response (via a server
   // returned Authentication-Info header). also used for session info.
   //
   nsAutoCString cnonce;
-  static const char hexChar[] = "0123456789abcdef"; 
+  static const char hexChar[] = "0123456789abcdef";
   for (int i=0; i<16; ++i) {
     cnonce.Append(hexChar[(int)(15.0 * rand()/(RAND_MAX + 1.0))]);
   }
   LOG(("   cnonce=%s\n", cnonce.get()));
 
   //
   // calculate credentials
   //
@@ -548,46 +548,46 @@ nsHttpDigestAuth::ParseChallenge(const c
   for (;;) {
     while (*p && (*p == ',' || nsCRT::IsAsciiSpace(*p)))
       ++p;
     if (!*p)
       break;
 
     // name
     int16_t nameStart = (p - challenge);
-    while (*p && !nsCRT::IsAsciiSpace(*p) && *p != '=') 
+    while (*p && !nsCRT::IsAsciiSpace(*p) && *p != '=')
       ++p;
     if (!*p)
       return NS_ERROR_INVALID_ARG;
     int16_t nameLength = (p - challenge) - nameStart;
 
-    while (*p && (nsCRT::IsAsciiSpace(*p) || *p == '=')) 
+    while (*p && (nsCRT::IsAsciiSpace(*p) || *p == '='))
       ++p;
-    if (!*p) 
+    if (!*p)
       return NS_ERROR_INVALID_ARG;
 
     bool quoted = false;
     if (*p == '"') {
       ++p;
       quoted = true;
     }
 
     // value
     int16_t valueStart = (p - challenge);
     int16_t valueLength = 0;
     if (quoted) {
-      while (*p && *p != '"') 
+      while (*p && *p != '"')
         ++p;
-      if (*p != '"') 
+      if (*p != '"')
         return NS_ERROR_INVALID_ARG;
       valueLength = (p - challenge) - valueStart;
       ++p;
     } else {
-      while (*p && !nsCRT::IsAsciiSpace(*p) && *p != ',') 
-        ++p; 
+      while (*p && !nsCRT::IsAsciiSpace(*p) && *p != ',')
+        ++p;
       valueLength = (p - challenge) - valueStart;
     }
 
     // extract information
     if (nameLength == 5 &&
         nsCRT::strncasecmp(challenge+nameStart, "realm", 5) == 0)
     {
       realm.Assign(challenge+valueStart, valueLength);
@@ -629,22 +629,22 @@ nsHttpDigestAuth::ParseChallenge(const c
     }
     else if (nameLength == 3 &&
         nsCRT::strncasecmp(challenge+nameStart, "qop", 3) == 0)
     {
       int16_t ipos = valueStart;
       while (ipos < valueStart+valueLength) {
         while (ipos < valueStart+valueLength &&
                (nsCRT::IsAsciiSpace(challenge[ipos]) ||
-                challenge[ipos] == ',')) 
+                challenge[ipos] == ','))
           ipos++;
         int16_t algostart = ipos;
         while (ipos < valueStart+valueLength &&
                !nsCRT::IsAsciiSpace(challenge[ipos]) &&
-               challenge[ipos] != ',') 
+               challenge[ipos] != ',')
           ipos++;
         if ((ipos - algostart) == 4 &&
             nsCRT::strncasecmp(challenge+algostart, "auth", 4) == 0)
           *qop |= QOP_AUTH;
         else if ((ipos - algostart) == 8 &&
             nsCRT::strncasecmp(challenge+algostart, "auth-int", 8) == 0)
           *qop |= QOP_AUTH_INT;
       }
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -128,20 +128,20 @@ public:
     //
     // Connection management methods:
     //
     // - the handler only owns idle connections; it does not own active
     //   connections.
     //
     // - the handler keeps a count of active connections to enforce the
     //   steady-state max-connections pref.
-    // 
+    //
 
     // Called to kick-off a new transaction, by default the transaction
-    // will be put on the pending transaction queue if it cannot be 
+    // will be put on the pending transaction queue if it cannot be
     // initiated at this time.  Callable from any thread.
     nsresult InitiateTransaction(nsHttpTransaction *trans, int32_t priority)
     {
         return mConnMgr->AddTransaction(trans, priority);
     }
 
     // Called to change the priority of an existing transaction that has
     // already been initiated.
@@ -253,17 +253,17 @@ public:
     {
         return mPipelineRescheduleOnTimeout;
     }
 
     PRIntervalTime GetPipelineRescheduleTimeout()
     {
         return mPipelineRescheduleTimeout;
     }
-    
+
     PRIntervalTime GetPipelineTimeout()   { return mPipelineReadTimeout; }
 
     mozilla::net::SpdyInformation *SpdyInfo() { return &mSpdyInfo; }
 
     // returns true in between Init and Shutdown states
     bool Active() { return mHandlerActive; }
 
     static void GetCacheSessionNameForStoragePolicy(
@@ -383,17 +383,17 @@ private:
 
     nsCString      mUserAgent;
     nsXPIDLCString mUserAgentOverride;
     bool           mUserAgentIsDirty; // true if mUserAgent should be rebuilt
 
     bool           mUseCache;
 
     bool           mPromptTempRedirect;
-    // mSendSecureXSiteReferrer: default is false, 
+    // mSendSecureXSiteReferrer: default is false,
     // if true allow referrer headers between secure non-matching hosts
     bool           mSendSecureXSiteReferrer;
 
     // Persistent HTTPS caching flag
     bool           mEnablePersistentHttpsCaching;
 
     // For broadcasting tracking preference
     bool           mDoNotTrackEnabled;
@@ -480,17 +480,17 @@ extern nsHttpHandler *gHttpHandler;
 
 class nsHttpsHandler : public nsIHttpProtocolHandler
                      , public nsSupportsWeakReference
                      , public nsISpeculativeConnect
 {
 public:
     // we basically just want to override GetScheme and GetDefaultPort...
     // all other methods should be forwarded to the nsHttpHandler instance.
-    
+
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPROTOCOLHANDLER
     NS_FORWARD_NSIPROXIEDPROTOCOLHANDLER (gHttpHandler->)
     NS_FORWARD_NSIHTTPPROTOCOLHANDLER    (gHttpHandler->)
     NS_FORWARD_NSISPECULATIVECONNECT     (gHttpHandler->)
 
     nsHttpsHandler() { }
     virtual ~nsHttpsHandler() { }
--- a/netwerk/protocol/http/nsHttpHeaderArray.cpp
+++ b/netwerk/protocol/http/nsHttpHeaderArray.cpp
@@ -130,32 +130,32 @@ nsHttpHeaderArray::ParseHeaderLine(const
     //
     //   message-header = field-name ":" [ field-value ]
     //   field-name     = token
     //   field-value    = *( field-content | LWS )
     //   field-content  = <the OCTETs making up the field-value
     //                     and consisting of either *TEXT or combinations
     //                     of token, separators, and quoted-string>
     //
-    
+
     // We skip over mal-formed headers in the hope that we'll still be able to
     // do something useful with the response.
 
     char *p = (char *) strchr(line, ':');
     if (!p) {
         LOG(("malformed header [%s]: no colon\n", line));
         return NS_OK;
     }
 
     // make sure we have a valid token for the field-name
     if (!nsHttp::IsValidToken(line, p)) {
         LOG(("malformed header [%s]: field-name not a token\n", line));
         return NS_OK;
     }
-    
+
     *p = 0; // null terminate field-name
 
     nsHttpAtom atom = nsHttp::ResolveAtom(line);
     if (!atom) {
         LOG(("failed to resolve atom [%s]\n", line));
         return NS_OK;
     }
 
@@ -179,17 +179,17 @@ nsHttpHeaderArray::ParseHeaderLine(const
 
 void
 nsHttpHeaderArray::Flatten(nsACString &buf, bool pruneProxyHeaders)
 {
     uint32_t i, count = mHeaders.Length();
     for (i = 0; i < count; ++i) {
         const nsEntry &entry = mHeaders[i];
         // prune proxy headers if requested
-        if (pruneProxyHeaders && ((entry.header == nsHttp::Proxy_Authorization) || 
+        if (pruneProxyHeaders && ((entry.header == nsHttp::Proxy_Authorization) ||
                                   (entry.header == nsHttp::Proxy_Connection)))
             continue;
         buf.Append(entry.header);
         buf.AppendLiteral(": ");
         buf.Append(entry.value);
         buf.AppendLiteral("\r\n");
     }
 }
--- a/netwerk/protocol/http/nsHttpHeaderArray.h
+++ b/netwerk/protocol/http/nsHttpHeaderArray.h
@@ -56,31 +56,31 @@ public:
     // Merges supported headers. For other duplicate values, determines if error
     // needs to be thrown or 1st value kept.
     nsresult SetHeaderFromNet(nsHttpAtom header, const nsACString &value);
 
     nsresult GetHeader(nsHttpAtom header, nsACString &value) const;
     void     ClearHeader(nsHttpAtom h);
 
     // Find the location of the given header value, or null if none exists.
-    const char *FindHeaderValue(nsHttpAtom header, const char *value) const 
+    const char *FindHeaderValue(nsHttpAtom header, const char *value) const
     {
         return nsHttp::FindToken(PeekHeader(header), value,
                                  HTTP_HEADER_VALUE_SEPS);
     }
 
     // Determine if the given header value exists.
     bool HasHeaderValue(nsHttpAtom header, const char *value) const
     {
         return FindHeaderValue(header, value) != nullptr;
     }
 
     nsresult VisitHeaders(nsIHttpHeaderVisitor *visitor);
 
-    // parse a header line, return the header atom and a pointer to the 
+    // parse a header line, return the header atom and a pointer to the
     // header value (the substring of the header line -- do not free).
     nsresult ParseHeaderLine(const char *line,
                              nsHttpAtom *header=nullptr,
                              char **value=nullptr);
 
     void Flatten(nsACString &, bool pruneProxyHeaders=false);
 
     uint32_t Count() const { return mHeaders.Length(); }
--- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp
+++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp
@@ -147,17 +147,17 @@ TestPref(nsIURI *uri, const char *pref)
         if (start == end)
             break;
         if (MatchesBaseURI(scheme, host, port, start, end))
             return true;
         if (*end == '\0')
             break;
         start = end + 1;
     }
-    
+
     nsMemory::Free(hostList);
     return false;
 }
 
 // Check to see if we should use our generic (internal) NTLM auth module.
 static bool
 ForceGenericNTLM()
 {
@@ -244,17 +244,17 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHtt
         nsCOMPtr<nsISupports> module;
 
         // Check to see if we should default to our generic NTLM auth module
         // through UseGenericNTLM. (We use native auth by default if the
         // system provides it.) If *sessionState is non-null, we failed to
         // instantiate a native NTLM module the last time, so skip trying again.
         bool forceGeneric = ForceGenericNTLM();
         if (!forceGeneric && !*sessionState) {
-            // Check for approved default credentials hosts and proxies. If 
+            // Check for approved default credentials hosts and proxies. If
             // *continuationState is non-null, the last authentication attempt
             // failed so skip default credential use.
             if (!*continuationState && CanUseDefaultCredentials(channel, isProxyAuth)) {
                 // Try logging in with the user's default credentials. If
                 // successful, |identityInvalid| is false, which will trigger
                 // a default credentials attempt once we return.
                 module = do_CreateInstance(NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm");
             }
@@ -291,17 +291,17 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHtt
                     return NS_ERROR_OUT_OF_MEMORY;
                 NS_ADDREF(*sessionState);
             }
 
             // Use our internal NTLM implementation. Note, this is less secure,
             // see bug 520607 for details.
             LOG(("Trying to fall back on internal ntlm auth.\n"));
             module = do_CreateInstance(NS_AUTH_MODULE_CONTRACTID_PREFIX "ntlm");
-	    
+	
             mUseNative = false;
 
             // Prompt user for domain, username, and password.
             *identityInvalid = true;
         }
 
         // If this fails, then it means that we cannot do NTLM auth.
         if (!module) {
@@ -331,17 +331,17 @@ nsHttpNTLMAuth::GenerateCredentials(nsIH
 {
     LOG(("nsHttpNTLMAuth::GenerateCredentials\n"));
 
     *creds = nullptr;
     *aFlags = 0;
 
     // if user or password is empty, ChallengeReceived returned
     // identityInvalid = false, that means we are using default user
-    // credentials; see  nsAuthSSPI::Init method for explanation of this 
+    // credentials; see  nsAuthSSPI::Init method for explanation of this
     // condition
     if (!user || !pass)
         *aFlags = USING_INTERNAL_IDENTITY;
 
     nsresult rv;
     nsCOMPtr<nsIAuthModule> module = do_QueryInterface(*continuationState, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -362,25 +362,25 @@ nsHttpNTLMAuth::GenerateCredentials(nsIH
         serviceName.AppendLiteral("HTTP@");
         serviceName.Append(host);
         // initialize auth module
         rv = module->Init(serviceName.get(), nsIAuthModule::REQ_DEFAULT, domain, user, pass);
         if (NS_FAILED(rv))
             return rv;
 
 // This update enables updated Windows machines (Win7 or patched previous
-// versions) and Linux machines running Samba (updated for Channel 
-// Binding), to perform Channel Binding when authenticating using NTLMv2 
+// versions) and Linux machines running Samba (updated for Channel
+// Binding), to perform Channel Binding when authenticating using NTLMv2
 // and an outer secure channel.
-// 
-// Currently only implemented for Windows, linux support will be landing in 
+//
+// Currently only implemented for Windows, linux support will be landing in
 // a separate patch, update this #ifdef accordingly then.
 #if defined (XP_WIN) /* || defined (LINUX) */
-        // We should retrieve the server certificate and compute the CBT, 
-        // but only when we are using the native NTLM implementation and 
+        // We should retrieve the server certificate and compute the CBT,
+        // but only when we are using the native NTLM implementation and
         // not the internal one.
         // It is a valid case not having the security info object.  This
         // occures when we connect an https site through an ntlm proxy.
         // After the ssl tunnel has been created, we get here the second
         // time and now generate the CBT from now valid security info.
         nsCOMPtr<nsIChannel> channel = do_QueryInterface(authChannel, &rv);
         if (NS_FAILED(rv))
             return rv;
@@ -401,23 +401,23 @@ nsHttpNTLMAuth::GenerateCredentials(nsIH
 
             nsCOMPtr<nsIX509Cert> cert;
             rv = status->GetServerCert(getter_AddRefs(cert));
             if (NS_FAILED(rv))
                 return rv;
 
             uint32_t length;
             uint8_t* certArray;
-            cert->GetRawDER(&length, &certArray);						  
+            cert->GetRawDER(&length, &certArray);						
 			
             // If there is a server certificate, we pass it along the
             // first time we call GetNextToken().
             inBufLen = length;
             inBuf = certArray;
-        } else { 
+        } else {
             // If there is no server certificate, we don't pass anything.
             inBufLen = 0;
             inBuf = nullptr;
         }
 #else // Extended protection update is just for Linux and Windows machines.
         inBufLen = 0;
         inBuf = nullptr;
 #endif
--- a/netwerk/protocol/http/nsHttpPipeline.cpp
+++ b/netwerk/protocol/http/nsHttpPipeline.cpp
@@ -94,17 +94,17 @@ nsHttpPipeline::AddTransaction(nsAHttpTr
     LOG(("nsHttpPipeline::AddTransaction [this=%x trans=%x]\n", this, trans));
 
     if (mRequestQ.Length() || mResponseQ.Length())
         mUtilizedPipeline = true;
 
     NS_ADDREF(trans);
     mRequestQ.AppendElement(trans);
     uint32_t qlen = PipelineDepth();
-    
+
     if (qlen != 1) {
         trans->SetPipelinePosition(qlen);
     }
     else {
         // do it for this case in case an idempotent cancellation
         // is being repeated and an old value needs to be cleared
         trans->SetPipelinePosition(0);
     }
@@ -139,17 +139,17 @@ nsHttpPipeline::PipelinePosition()
 {
     nsAHttpTransaction *trans = Response(0);
     if (trans)
         return trans->PipelinePosition();
 
     // The response queue is empty, so return oldest request
     if (mRequestQ.Length())
         return Request(mRequestQ.Length() - 1)->PipelinePosition();
-    
+
     // No transactions in the pipeline
     return 0;
 }
 
 nsHttpPipeline *
 nsHttpPipeline::QueryPipeline()
 {
     return this;
@@ -177,29 +177,29 @@ nsHttpPipeline::OnHeadersAvailable(nsAHt
                                    nsHttpRequestHead *requestHead,
                                    nsHttpResponseHead *responseHead,
                                    bool *reset)
 {
     LOG(("nsHttpPipeline::OnHeadersAvailable [this=%x]\n", this));
 
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     MOZ_ASSERT(mConnection, "no connection");
-    
+
     nsRefPtr<nsHttpConnectionInfo> ci;
     GetConnectionInfo(getter_AddRefs(ci));
     MOZ_ASSERT(ci);
-    
+
     bool pipeliningBefore = gHttpHandler->ConnMgr()->SupportsPipelining(ci);
-    
+
     // trans has now received its response headers; forward to the real connection
     nsresult rv = mConnection->OnHeadersAvailable(trans,
                                                   requestHead,
                                                   responseHead,
                                                   reset);
-    
+
     if (!pipeliningBefore && gHttpHandler->ConnMgr()->SupportsPipelining(ci))
         // The received headers have expanded the eligible
         // pipeline depth for this connection
         gHttpHandler->ConnMgr()->ProcessPendingQForEntry(ci);
 
     return rv;
 }
 
@@ -208,17 +208,17 @@ nsHttpPipeline::CloseTransaction(nsAHttp
 {
     LOG(("nsHttpPipeline::CloseTransaction [this=%x trans=%x reason=%x]\n",
         this, trans, reason));
 
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     MOZ_ASSERT(NS_FAILED(reason), "expecting failure code");
 
     // the specified transaction is to be closed with the given "reason"
-    
+
     int32_t index;
     bool killPipeline = false;
 
     index = mRequestQ.IndexOf(trans);
     if (index >= 0) {
         if (index == 0 && mRequestIsPartial) {
             // the transaction is in the request queue.  check to see if any of
             // its data has been written out yet.
@@ -283,17 +283,17 @@ nsHttpPipeline::DontReuse()
     if (mConnection)
         mConnection->DontReuse();
 }
 
 nsresult
 nsHttpPipeline::PushBack(const char *data, uint32_t length)
 {
     LOG(("nsHttpPipeline::PushBack [this=%x len=%u]\n", this, length));
-    
+
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     MOZ_ASSERT(mPushBackLen == 0, "push back buffer already has data!");
 
     // If we have no chance for a pipeline (e.g. due to an Upgrade)
     // then push this data down to original connection
     if (!mConnection->IsPersistent())
         return mConnection->PushBack(data, length);
 
@@ -317,17 +317,17 @@ nsHttpPipeline::PushBack(const char *dat
     else if (length > mPushBackMax) {
         // grow push back buffer as necessary.
         MOZ_ASSERT(length <= nsIOService::gDefaultSegmentSize, "too big");
         mPushBackMax = length;
         mPushBackBuf = (char *) realloc(mPushBackBuf, mPushBackMax);
         if (!mPushBackBuf)
             return NS_ERROR_OUT_OF_MEMORY;
     }
- 
+
     memcpy(mPushBackBuf, data, length);
     mPushBackLen = length;
 
     return NS_OK;
 }
 
 nsHttpConnection *
 nsHttpPipeline::TakeHttpConnection()
@@ -475,43 +475,43 @@ nsHttpPipeline::OnTransportStatus(nsITra
         //
         // In pipelining this is generated out of FillSendBuf(), but it cannot do
         // so until the connection is confirmed by CONNECTED_TO.
         // See patch for bug 196827.
         //
 
         if (mSuppressSendEvents) {
             mSuppressSendEvents = false;
-            
+
             // catch up by sending the event to all the transactions that have
             // moved from request to response and any that have been partially
             // sent. Also send WAITING_FOR to those that were completely sent
             count = mResponseQ.Length();
             for (i = 0; i < count; ++i) {
                 Response(i)->OnTransportStatus(transport,
                                                NS_NET_STATUS_SENDING_TO,
                                                progress);
-                Response(i)->OnTransportStatus(transport, 
+                Response(i)->OnTransportStatus(transport,
                                                NS_NET_STATUS_WAITING_FOR,
                                                progress);
             }
             if (mRequestIsPartial && Request(0))
                 Request(0)->OnTransportStatus(transport,
                                               NS_NET_STATUS_SENDING_TO,
                                               progress);
             mSendingToProgress = progress;
         }
         // otherwise ignore it
         break;
-        
-    case NS_NET_STATUS_WAITING_FOR: 
+
+    case NS_NET_STATUS_WAITING_FOR:
         // Created by nsHttpConnection when request pipeline has been totally
         // sent. Ignore it here because it is simulated in FillSendBuf() when
         // a request is moved from request to response.
-        
+
         // ignore it
         break;
 
     case NS_NET_STATUS_RECEIVING_FROM:
         // Forward this only to the transaction currently recieving data. It is
         // normally generated by the socket transport, but can also
         // be repeated by the pushbackwriter if necessary.
         mReceivingFromProgress = progress;
@@ -527,25 +527,25 @@ nsHttpPipeline::OnTransportStatus(nsITra
         break;
     }
 }
 
 bool
 nsHttpPipeline::IsDone()
 {
     bool done = true;
-    
+
     uint32_t i, count = mRequestQ.Length();
     for (i = 0; done && (i < count); i++)
         done = Request(i)->IsDone();
 
     count = mResponseQ.Length();
     for (i = 0; done && (i < count); i++)
         done = Response(i)->IsDone();
-    
+
     return done;
 }
 
 nsresult
 nsHttpPipeline::Status()
 {
     return mStatus;
 }
@@ -638,17 +638,17 @@ nsHttpPipeline::WriteSegments(nsAHttpSeg
 {
     LOG(("nsHttpPipeline::WriteSegments [this=%x count=%u]\n", this, count));
 
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
     if (mClosed)
         return NS_SUCCEEDED(mStatus) ? NS_BASE_STREAM_CLOSED : mStatus;
 
-    nsAHttpTransaction *trans; 
+    nsAHttpTransaction *trans;
     nsresult rv;
 
     trans = Response(0);
     // This code deals with the establishment of a CONNECT tunnel through
     // an HTTP proxy. It allows the connection to do the CONNECT/200
     // HTTP transaction to establish a tunnel as a precursor to the
     // actual pipeline of regular HTTP transactions.
     if (!trans && mRequestQ.Length() &&
@@ -660,17 +660,17 @@ nsHttpPipeline::WriteSegments(nsAHttpSeg
 
     if (!trans) {
         if (mRequestQ.Length() > 0)
             rv = NS_BASE_STREAM_WOULD_BLOCK;
         else
             rv = NS_BASE_STREAM_CLOSED;
     }
     else {
-        // 
+        //
         // ask the transaction to consume data from the connection.
         // PushBack may be called recursively.
         //
         rv = trans->WriteSegments(writer, count, countWritten);
 
         if (rv == NS_BASE_STREAM_CLOSED || trans->IsDone()) {
             trans->Close(NS_OK);
 
@@ -821,17 +821,17 @@ nsHttpPipeline::OnReadSegment(const char
 
 nsresult
 nsHttpPipeline::FillSendBuf()
 {
     // reads from request queue, moving transactions to response queue
     // when they have been completely read.
 
     nsresult rv;
-    
+
     if (!mSendBufIn) {
         // allocate a single-segment pipe
         rv = NS_NewPipe(getter_AddRefs(mSendBufIn),
                         getter_AddRefs(mSendBufOut),
                         nsIOService::gDefaultSegmentSize,  /* segment size */
                         nsIOService::gDefaultSegmentSize,  /* max size */
                         true, true);
         if (NS_FAILED(rv)) return rv;
@@ -849,17 +849,17 @@ nsHttpPipeline::FillSendBuf()
             // new data comprises a pipeline. Update the transaction in the
             // response queue to reflect that if necessary. We are now sending
             // out a request while we haven't received all responses.
             nsAHttpTransaction *response = Response(0);
             if (response && !response->PipelinePosition())
                 response->SetPipelinePosition(1);
             rv = trans->ReadSegments(this, (uint32_t)std::min(avail, (uint64_t)UINT32_MAX), &n);
             if (NS_FAILED(rv)) return rv;
-            
+
             if (n == 0) {
                 LOG(("send pipe is full"));
                 break;
             }
 
             mSendingToProgress += n;
             if (!mSuppressSendEvents && transport) {
                 // Simulate a SENDING_TO event
--- a/netwerk/protocol/http/nsHttpPipeline.h
+++ b/netwerk/protocol/http/nsHttpPipeline.h
@@ -24,17 +24,17 @@ public:
     NS_DECL_NSAHTTPTRANSACTION
     NS_DECL_NSAHTTPSEGMENTREADER
 
     nsHttpPipeline();
     virtual ~nsHttpPipeline();
 
 private:
     nsresult FillSendBuf();
-    
+
     static NS_METHOD ReadFromPipe(nsIInputStream *, void *, const char *,
                                   uint32_t, uint32_t, uint32_t *);
 
     // convenience functions
     nsAHttpTransaction *Request(int32_t i)
     {
         if (mRequestQ.Length() == 0)
             return nullptr;
@@ -53,17 +53,17 @@ private:
     nsHttpPipeline *QueryPipeline();
 
     nsAHttpConnection            *mConnection;
     nsTArray<nsAHttpTransaction*> mRequestQ;  // array of transactions
     nsTArray<nsAHttpTransaction*> mResponseQ; // array of transactions
     nsresult                      mStatus;
 
     // these flags indicate whether or not the first request or response
-    // is partial.  a partial request means that Request(0) has been 
+    // is partial.  a partial request means that Request(0) has been
     // partially written out to the socket.  a partial response means
     // that Response(0) has been partially read in from the socket.
     bool mRequestIsPartial;
     bool mResponseIsPartial;
 
     // indicates whether or not the pipeline has been explicitly closed.
     bool mClosed;
 
--- a/netwerk/protocol/http/nsHttpRequestHead.cpp
+++ b/netwerk/protocol/http/nsHttpRequestHead.cpp
@@ -8,17 +8,17 @@
 //-----------------------------------------------------------------------------
 // nsHttpRequestHead
 //-----------------------------------------------------------------------------
 
 void
 nsHttpRequestHead::Flatten(nsACString &buf, bool pruneProxyHeaders)
 {
     // note: the first append is intentional.
- 
+
     buf.Append(mMethod.get());
     buf.Append(' ');
     buf.Append(mRequestURI);
     buf.AppendLiteral(" HTTP/");
 
     switch (mVersion) {
     case NS_HTTP_VERSION_1_1:
         buf.AppendLiteral("1.1");
--- a/netwerk/protocol/http/nsHttpResponseHead.cpp
+++ b/netwerk/protocol/http/nsHttpResponseHead.cpp
@@ -129,20 +129,20 @@ nsHttpResponseHead::Parse(char *block)
 }
 
 void
 nsHttpResponseHead::ParseStatusLine(const char *line)
 {
     //
     // Parse Status-Line:: HTTP-Version SP Status-Code SP Reason-Phrase CRLF
     //
- 
+
     // HTTP-Version
     ParseVersion(line);
-    
+
     if ((mVersion == NS_HTTP_VERSION_0_9) || !(line = PL_strchr(line, ' '))) {
         mStatus = 200;
         mStatusText.AssignLiteral("OK");
     }
     else {
         // Status-Code
         mStatus = (uint16_t) atoi(++line);
         if (mStatus == 0) {
@@ -164,33 +164,33 @@ nsHttpResponseHead::ParseStatusLine(cons
 }
 
 nsresult
 nsHttpResponseHead::ParseHeaderLine(const char *line)
 {
     nsHttpAtom hdr = {0};
     char *val;
     nsresult rv;
-    
+
     rv = mHeaders.ParseHeaderLine(line, &hdr, &val);
     if (NS_FAILED(rv))
         return rv;
-    
+
     // leading and trailing LWS has been removed from |val|
 
     // handle some special case headers...
     if (hdr == nsHttp::Content_Length) {
         int64_t len;
         const char *ignored;
         // permit only a single value here.
         if (nsHttp::ParseInt64(val, &ignored, &len)) {
             mContentLength = len;
         }
         else {
-            // If this is a negative content length then just ignore it 
+            // If this is a negative content length then just ignore it
             LOG(("invalid content-length! %s\n", val));
         }
     }
     else if (hdr == nsHttp::Content_Type) {
         LOG(("ParseContentType [type=%s]\n", val));
         bool dummy;
         net_ParseContentType(nsDependentCString(val),
                              mContentType, mContentCharset, &dummy);
@@ -273,17 +273,17 @@ nsHttpResponseHead::ComputeFreshnessLife
 
     // Try HTTP/1.0 style expires header...
     if (NS_SUCCEEDED(GetExpiresValue(&date2))) {
         if (date2 > date)
             *result = date2 - date;
         // the Expires header can specify a date in the past.
         return NS_OK;
     }
-    
+
     // Fallback on heuristic using last modified header...
     if (NS_SUCCEEDED(GetLastModifiedValue(&date2))) {
         LOG(("using last-modified to determine freshness-lifetime\n"));
         LOG(("last-modified = %u, date = %u\n", date2, date));
         if (date2 <= date) {
             // this only makes sense if last-modified is actually in the past
             *result = (date - date2) / 10;
             return NS_OK;
@@ -330,17 +330,17 @@ nsHttpResponseHead::MustValidate() const
     case 401:
     case 407:
     case 412:
     case 416:
     default:  // revalidate unknown error pages
         LOG(("Must validate since response is an uncacheable error page\n"));
         return true;
     }
-    
+
     // The no-cache response header indicates that we must validate this
     // cached response before reusing.
     if (NoCache()) {
         LOG(("Must validate since response contains 'no-cache' header\n"));
         return true;
     }
 
     // Likewise, if the response is no-store, then we must validate this
@@ -364,48 +364,48 @@ nsHttpResponseHead::MustValidate() const
     return false;
 }
 
 bool
 nsHttpResponseHead::MustValidateIfExpired() const
 {
     // according to RFC2616, section 14.9.4:
     //
-    //  When the must-revalidate directive is present in a response received by a   
-    //  cache, that cache MUST NOT use the entry after it becomes stale to respond to 
+    //  When the must-revalidate directive is present in a response received by a
+    //  cache, that cache MUST NOT use the entry after it becomes stale to respond to
     //  a subsequent request without first revalidating it with the origin server.
     //
     return HasHeaderValue(nsHttp::Cache_Control, "must-revalidate");
 }
 
 bool
 nsHttpResponseHead::IsResumable() const
 {
     // even though some HTTP/1.0 servers may support byte range requests, we're not
     // going to bother with them, since those servers wouldn't understand If-Range.
     // Also, while in theory it may be possible to resume when the status code
     // is not 200, it is unlikely to be worth the trouble, especially for
     // non-2xx responses.
     return mStatus == 200 &&
            mVersion >= NS_HTTP_VERSION_1_1 &&
-           PeekHeader(nsHttp::Content_Length) && 
+           PeekHeader(nsHttp::Content_Length) &&
           (PeekHeader(nsHttp::ETag) || PeekHeader(nsHttp::Last_Modified)) &&
            HasHeaderValue(nsHttp::Accept_Ranges, "bytes");
 }
 
 bool
 nsHttpResponseHead::ExpiresInPast() const
 {
     uint32_t maxAgeVal, expiresVal, dateVal;
-    
+
     // Bug #203271. Ensure max-age directive takes precedence over Expires
     if (NS_SUCCEEDED(GetMaxAgeValue(&maxAgeVal))) {
         return false;
     }
-    
+
     return NS_SUCCEEDED(GetExpiresValue(&expiresVal)) &&
            NS_SUCCEEDED(GetDateValue(&dateVal)) &&
            expiresVal < dateVal;
 }
 
 nsresult
 nsHttpResponseHead::UpdateHeaders(const nsHttpHeaderArray &headers)
 {
@@ -480,17 +480,17 @@ nsHttpResponseHead::ParseDateHeader(nsHt
     if (!val)
         return NS_ERROR_NOT_AVAILABLE;
 
     PRTime time;
     PRStatus st = PR_ParseTimeString(val, true, &time);
     if (st != PR_SUCCESS)
         return NS_ERROR_NOT_AVAILABLE;
 
-    *result = PRTimeToSeconds(time); 
+    *result = PRTimeToSeconds(time);
     return NS_OK;
 }
 
 nsresult
 nsHttpResponseHead::GetAgeValue(uint32_t *result) const
 {
     const char *val = PeekHeader(nsHttp::Age);
     if (!val)
@@ -534,17 +534,17 @@ nsHttpResponseHead::GetExpiresValue(uint
         // as an expiration time in the past.
         *result = 0;
         return NS_OK;
     }
 
     if (time < 0)
         *result = 0;
     else
-        *result = PRTimeToSeconds(time); 
+        *result = PRTimeToSeconds(time);
     return NS_OK;
 }
 
 int64_t
 nsHttpResponseHead::TotalEntitySize() const
 {
     const char* contentRange = PeekHeader(nsHttp::Content_Range);
     if (!contentRange)
@@ -622,17 +622,17 @@ nsHttpResponseHead::ParseCacheControl(co
         return;
     }
 
     // search header value for occurrence(s) of "no-cache" but ignore
     // occurrence(s) of "no-cache=blah"
     if (nsHttp::FindToken(val, "no-cache", HTTP_HEADER_VALUE_SEPS))
         mCacheControlNoCache = true;
 
-    // search header value for occurrence of "no-store" 
+    // search header value for occurrence of "no-store"
     if (nsHttp::FindToken(val, "no-store", HTTP_HEADER_VALUE_SEPS))
         mCacheControlNoStore = true;
 }
 
 void
 nsHttpResponseHead::ParsePragma(const char *val)
 {
     LOG(("nsHttpResponseHead::ParsePragma [val=%s]\n", val));
--- a/netwerk/protocol/http/nsHttpResponseHead.h
+++ b/netwerk/protocol/http/nsHttpResponseHead.h
@@ -19,17 +19,17 @@ class nsHttpResponseHead
 {
 public:
     nsHttpResponseHead() : mVersion(NS_HTTP_VERSION_1_1)
                          , mStatus(200)
                          , mContentLength(UINT64_MAX)
                          , mCacheControlNoStore(false)
                          , mCacheControlNoCache(false)
                          , mPragmaNoCache(false) {}
-    
+
     const nsHttpHeaderArray & Headers()   const { return mHeaders; }
     nsHttpHeaderArray    &Headers()             { return mHeaders; }
     nsHttpVersion         Version()       const { return mVersion; }
     uint16_t              Status()        const { return mStatus; }
     const nsAFlatCString &StatusText()    const { return mStatusText; }
     int64_t               ContentLength() const { return mContentLength; }
     const nsAFlatCString &ContentType()   const { return mContentType; }
     const nsAFlatCString &ContentCharset() const { return mContentCharset; }
@@ -85,17 +85,17 @@ public:
     // returns true if the server appears to support byte range requests.
     bool     IsResumable() const;
 
     // returns true if the Expires header has a value in the past relative to the
     // value of the Date header.
     bool     ExpiresInPast() const;
 
     // update headers...
-    nsresult UpdateHeaders(const nsHttpHeaderArray &headers); 
+    nsresult UpdateHeaders(const nsHttpHeaderArray &headers);
 
     // reset the response head to it's initial state
     void     Reset();
 
     // these return failure if the header does not exist.
     nsresult ParseDateHeader(nsHttpAtom header, uint32_t *result) const;
     nsresult GetAgeValue(uint32_t *result) const;
     nsresult GetMaxAgeValue(uint32_t *result) const;
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -216,17 +216,17 @@ nsHttpTransaction::Init(uint32_t caps,
              "mActivityDistributor is active " \
              "this=%x", this));
     } else {
         // there is no observer, so don't use it
         activityDistributorActive = false;
         mActivityDistributor = nullptr;
     }
 
-    // create transport event sink proxy. it coalesces all events if and only 
+    // create transport event sink proxy. it coalesces all events if and only
     // if the activity observer is not active. when the observer is active
     // we need not to coalesce any events to get all expected notifications
     // of the transaction state, necessary for correct debugging and logging.
     rv = net_NewTransportEventSinkProxy(getter_AddRefs(mTransportSink),
                                         eventsink, target,
                                         !activityDistributorActive);
     if (NS_FAILED(rv)) return rv;
 
@@ -253,20 +253,20 @@ nsHttpTransaction::Init(uint32_t caps,
     if ((requestHead->Method() == nsHttp::Post || requestHead->Method() == nsHttp::Put) &&
         !requestBody && !requestHead->PeekHeader(nsHttp::Transfer_Encoding)) {
         requestHead->SetHeader(nsHttp::Content_Length, NS_LITERAL_CSTRING("0"));
     }
 
     // grab a weak reference to the request head
     mRequestHead = requestHead;
 
-    // make sure we eliminate any proxy specific headers from 
+    // make sure we eliminate any proxy specific headers from
     // the request if we are using CONNECT
     bool pruneProxyHeaders = cinfo->UsingConnect();
-    
+
     mReqHeaderBuf.Truncate();
     requestHead->Flatten(mReqHeaderBuf, pruneProxyHeaders);
 
 #if defined(PR_LOGGING)
     if (LOG3_ENABLED()) {
         LOG3(("http request [\n"));
         LogHeaders(mReqHeaderBuf.get());
         LOG3(("]\n"));
@@ -356,17 +356,17 @@ nsHttpTransaction::TakeResponseHead()
     // Prefer mForTakeResponseHead over mResponseHead. It is always a complete
     // set of headers.
     nsHttpResponseHead *head;
     if (mForTakeResponseHead) {
         head = mForTakeResponseHead;
         mForTakeResponseHead = nullptr;
         return head;
     }
-    
+
     // Even in OnStartRequest() the headers won't be available if we were
     // canceled
     if (!mHaveAllHeaders) {
         NS_WARNING("response headers not available or incomplete");
         return nullptr;
     }
 
     head = mResponseHead;
@@ -522,17 +522,17 @@ nsHttpTransaction::IsDone()
 nsresult
 nsHttpTransaction::Status()
 {
     return mStatus;
 }
 
 uint32_t
 nsHttpTransaction::Caps()
-{ 
+{
     return mCaps;
 }
 
 uint64_t
 nsHttpTransaction::Available()
 {
     uint64_t size;
     if (NS_FAILED(mRequestStream->Available(&size)))
@@ -640,17 +640,17 @@ nsHttpTransaction::WritePipeSegment(nsIO
     MOZ_ASSERT(*countWritten > 0, "bad writer");
     trans->mReceivedData = true;
 
     // Let the transaction "play" with the buffer.  It is free to modify
     // the contents of the buffer and/or modify countWritten.
     // - Bytes in HTTP headers don't count towards countWritten, so the input
     // side of pipe (aka nsHttpChannel's mTransactionPump) won't hit
     // OnInputStreamReady until all headers have been parsed.
-    //    
+    //
     rv = trans->ProcessData(buf, *countWritten, countWritten);
     if (NS_FAILED(rv))
         trans->Close(rv);
 
     return rv; // failure code only stops WriteSegments; it is not propagated.
 }
 
 nsresult
@@ -715,17 +715,17 @@ nsHttpTransaction::Close(nsresult reason
         // report that this transaction is closing
         mActivityDistributor->ObserveActivity(
             mChannel,
             NS_HTTP_ACTIVITY_TYPE_HTTP_TRANSACTION,
             NS_HTTP_ACTIVITY_SUBTYPE_TRANSACTION_CLOSE,
             PR_Now(), 0, EmptyCString());
     }
 
-    // we must no longer reference the connection!  find out if the 
+    // we must no longer reference the connection!  find out if the
     // connection was being reused before letting it go.
     bool connReused = false;
     if (mConnection)
         connReused = mConnection->IsReused();
     mConnected = false;
 
     //
     // if the connection was reset or closed before we wrote any part of the
@@ -746,22 +746,22 @@ nsHttpTransaction::Close(nsresult reason
     //
     if (reason == NS_ERROR_NET_RESET || reason == NS_OK) {
 
         // reallySentData is meant to separate the instances where data has
         // been sent by this transaction but buffered at a higher level while
         // a TLS session (perhaps via a tunnel) is setup.
         bool reallySentData =
             mSentData && (!mConnection || mConnection->BytesWritten());
-        
+
         if (!mReceivedData &&
             (!reallySentData || connReused || mPipelinePosition)) {
             // if restarting fails, then we must proceed to close the pipe,
             // which will notify the channel that the transaction failed.
-            
+
             if (mPipelinePosition) {
                 gHttpHandler->ConnMgr()->PipelineFeedbackInfo(
                     mConnInfo, nsHttpConnectionMgr::RedCanceledPipeline,
                     nullptr, 0);
             }
             if (NS_SUCCEEDED(Restart()))
                 return;
         }
@@ -859,32 +859,32 @@ nsHttpTransaction::PipelineDepth()
 }
 
 nsresult
 nsHttpTransaction::SetPipelinePosition(int32_t position)
 {
     mPipelinePosition = position;
     return NS_OK;
 }
- 
+
 int32_t
 nsHttpTransaction::PipelinePosition()
 {
     return mPipelinePosition;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpTransaction <private>
 //-----------------------------------------------------------------------------
 
 nsresult
 nsHttpTransaction::RestartInProgress()
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-    
+
     if ((mRestartCount + 1) >= gHttpHandler->MaxRequestAttempts()) {
         LOG(("nsHttpTransaction::RestartInProgress() "
              "reached max request attempts, failing transaction %p\n", this));
         return NS_ERROR_NET_RESET;
     }
 
     // Lock RestartInProgress() and TakeResponseHead() against main thread
     MutexAutoLock lock(*nsHttp::GetLock());
@@ -972,17 +972,17 @@ nsHttpTransaction::LocateHttpStart(char 
                                    bool aAllowPartialMatch)
 {
     MOZ_ASSERT(!aAllowPartialMatch || mLineBuf.IsEmpty());
 
     static const char HTTPHeader[] = "HTTP/1.";
     static const uint32_t HTTPHeaderLen = sizeof(HTTPHeader) - 1;
     static const char HTTP2Header[] = "HTTP/2.0";
     static const uint32_t HTTP2HeaderLen = sizeof(HTTP2Header) - 1;
-    
+
     if (aAllowPartialMatch && (len < HTTPHeaderLen))
         return (PL_strncasecmp(buf, HTTPHeader, len) == 0) ? buf : nullptr;
 
     // mLineBuf can contain partial match from previous search
     if (!mLineBuf.IsEmpty()) {
         MOZ_ASSERT(mLineBuf.Length() < HTTPHeaderLen);
         int32_t checkChars = std::min(len, HTTPHeaderLen - mLineBuf.Length());
         if (PL_strncasecmp(buf, HTTPHeader + mLineBuf.Length(),
@@ -1034,17 +1034,17 @@ nsHttpTransaction::LocateHttpStart(char 
     return 0;
 }
 
 nsresult
 nsHttpTransaction::ParseLine(char *line)
 {
     LOG(("nsHttpTransaction::ParseLine [%s]\n", line));
     nsresult rv = NS_OK;
-    
+
     if (!mHaveStatusLine) {
         mResponseHead->ParseStatusLine(line);
         mHaveStatusLine = true;
         // XXX this should probably never happen
         if (mResponseHead->Version() == NS_HTTP_VERSION_0_9)
             mHaveAllHeaders = true;
     }
     else {
@@ -1073,17 +1073,17 @@ nsHttpTransaction::ParseLineSegment(char
                     nullptr, 0);
                 return rv;
             }
         }
     }
 
     // append segment to mLineBuf...
     mLineBuf.Append(segment, len);
-    
+
     // a line buf with only a new line char signifies the end of headers.
     if (mLineBuf.First() == '\n') {
         mLineBuf.Truncate();
         // discard this response if it is a 100 continue or other 1xx status.
         uint16_t status = mResponseHead->Status();
         if ((status != 101) && (status / 100 == 1)) {
             LOG(("ignoring 1xx response\n"));
             mHaveStatusLine = false;
@@ -1106,17 +1106,17 @@ nsHttpTransaction::ParseHead(char *buf,
     uint32_t len;
     char *eol;
 
     LOG(("nsHttpTransaction::ParseHead [count=%u]\n", count));
 
     *countRead = 0;
 
     NS_PRECONDITION(!mHaveAllHeaders, "oops");
-        
+
     // allocate the response head object if necessary
     if (!mResponseHead) {
         mResponseHead = new nsHttpResponseHead();
         if (!mResponseHead)
             return NS_ERROR_OUT_OF_MEMORY;
 
         // report that we have a least some of the response
         if (mActivityDistributor && !mReportedStart) {
@@ -1266,17 +1266,17 @@ nsHttpTransaction::HandleContentStart()
             mPreserveStream = true;    // fall through to other no content
         case 204:
         case 205:
         case 304:
             mNoContent = true;
             LOG(("this response should not contain a body.\n"));
             break;
         }
-        
+
         if (mResponseHead->Status() == 200 &&
             mConnection->IsProxyConnectInProgress()) {
             // successful CONNECTs do not have response bodies
             mNoContent = true;
         }
         mConnection->SetLastTransactionExpectedNoContent(mNoContent);
         if (mInvalidResponseBytesRead)
             gHttpHandler->ConnMgr()->PipelineFeedbackInfo(
@@ -1287,17 +1287,17 @@ nsHttpTransaction::HandleContentStart()
             mContentLength = 0;
         else {
             // grab the content-length from the response headers
             mContentLength = mResponseHead->ContentLength();
 
             if ((mClassification != CLASS_SOLO) &&
                 (mContentLength > mMaxPipelineObjectSize))
                 CancelPipeline(nsHttpConnectionMgr::BadUnexpectedLarge);
-            
+
             // handle chunked encoding here, so we'll know immediately when
             // we're done with the socket.  please note that _all_ other
             // decoding is done when the channel receives the content data
             // so as not to block the socket transport thread too much.
             // ignore chunked responses from HTTP/1.0 servers and proxies.
             if (mResponseHead->Version() >= NS_HTTP_VERSION_1_1 &&
                 mResponseHead->HasHeaderValue(nsHttp::Transfer_Encoding, "chunked")) {
                 // we only support the "chunked" transfer encoding right now.
@@ -1381,17 +1381,17 @@ nsHttpTransaction::HandleContent(char *b
             }
         }
     }
     else {
         // when we are just waiting for the server to close the connection...
         // (no explicit content-length given)
         *contentRead = count;
     }
-    
+
     int64_t toReadBeforeRestart =
         mRestartInProgressVerifier.ToReadBeforeRestart();
 
     if (toReadBeforeRestart && *contentRead) {
         uint32_t ignore =
             static_cast<uint32_t>(std::min<int64_t>(toReadBeforeRestart, UINT32_MAX));
         ignore = std::min(*contentRead, ignore);
         LOG(("Due To Restart ignoring %d of remaining %ld",
@@ -1460,23 +1460,23 @@ nsHttpTransaction::ProcessData(char *buf
     // we may not have read all of the headers yet...
     if (!mHaveAllHeaders) {
         uint32_t bytesConsumed = 0;
 
         do {
             uint32_t localBytesConsumed = 0;
             char *localBuf = buf + bytesConsumed;
             uint32_t localCount = count - bytesConsumed;
-            
+
             rv = ParseHead(localBuf, localCount, &localBytesConsumed);
             if (NS_FAILED(rv) && rv != NS_ERROR_NET_INTERRUPT)
                 return rv;
             bytesConsumed += localBytesConsumed;
         } while (rv == NS_ERROR_NET_INTERRUPT);
-        
+
         count -= bytesConsumed;
 
         // if buf has some content in it, shift bytes to top of buf.
         if (count && bytesConsumed)
             memmove(buf, buf + bytesConsumed, count);
 
         // report the completed response header
         if (mActivityDistributor && mResponseHead && mHaveAllHeaders &&
@@ -1495,17 +1495,17 @@ nsHttpTransaction::ProcessData(char *buf
     }
 
     // even though count may be 0, we still want to call HandleContent
     // so it can complete the transaction if this is a "no-content" response.
     if (mHaveAllHeaders) {
         uint32_t countRemaining = 0;
         //
         // buf layout:
-        // 
+        //
         // +--------------------------------------+----------------+-----+
         // |              countRead               | countRemaining |     |
         // +--------------------------------------+----------------+-----+
         //
         // count          : bytes read from the socket
         // countRead      : bytes corresponding to this transaction
         // countRemaining : bytes corresponding to next pipelined transaction
         //
@@ -1548,46 +1548,46 @@ nsHttpTransaction::CancelPipeline(uint32
 // having an effect once.
 void
 nsHttpTransaction::DispatchedAsBlocking()
 {
     if (mDispatchedAsBlocking)
         return;
 
     LOG(("nsHttpTransaction %p dispatched as blocking\n", this));
-    
+
     if (!mLoadGroupCI)
         return;
 
     LOG(("nsHttpTransaction adding blocking channel %p from "
          "loadgroup %p\n", this, mLoadGroupCI.get()));
-    
+
     mLoadGroupCI->AddBlockingTransaction();
     mDispatchedAsBlocking = true;
 }
 
 void
 nsHttpTransaction::RemoveDispatchedAsBlocking()
 {
     if (!mLoadGroupCI || !mDispatchedAsBlocking)
         return;
-    
+
     uint32_t blockers = 0;
     nsresult rv = mLoadGroupCI->RemoveBlockingTransaction(&blockers);
 
     LOG(("nsHttpTransaction removing blocking channel %p from "
          "loadgroup %p. %d blockers remain.\n", this,
          mLoadGroupCI.get(), blockers));
 
     if (NS_SUCCEEDED(rv) && !blockers) {
         LOG(("nsHttpTransaction %p triggering release of blocked channels.\n",
              this));
         gHttpHandler->ConnMgr()->ProcessPendingQ();
     }
-    
+
     mDispatchedAsBlocking = false;
 }
 
 void
 nsHttpTransaction::ReleaseBlockingTransaction()
 {
     RemoveDispatchedAsBlocking();
     mLoadGroupCI = nullptr;
@@ -1611,17 +1611,17 @@ public:
 private:
     nsHttpTransaction *mTrans;
 };
 
 void
 nsHttpTransaction::DeleteSelfOnConsumerThread()
 {
     LOG(("nsHttpTransaction::DeleteSelfOnConsumerThread [this=%x]\n", this));
-    
+
     bool val;
     if (!mConsumerTarget ||
         (NS_SUCCEEDED(mConsumerTarget->IsOnCurrentThread(&val)) && val)) {
         delete this;
     } else {
         LOG(("proxying delete to consumer thread...\n"));
         nsCOMPtr<nsIRunnable> event = new nsDeleteHttpTransaction(this);
         if (NS_FAILED(mConsumerTarget->Dispatch(event, NS_DISPATCH_NORMAL)))
@@ -1671,17 +1671,17 @@ NS_IMETHODIMP_(nsrefcnt)
 nsHttpTransaction::Release()
 {
     nsrefcnt count;
     NS_PRECONDITION(0 != mRefCnt, "dup release");
     count = NS_AtomicDecrementRefcnt(mRefCnt);
     NS_LOG_RELEASE(this, count, "nsHttpTransaction");
     if (0 == count) {
         mRefCnt = 1; /* stablize */
-        // it is essential that the transaction be destroyed on the consumer 
+        // it is essential that the transaction be destroyed on the consumer
         // thread (we could be holding the last reference to our consumer).
         DeleteSelfOnConsumerThread();
         return 0;
     }
     return count;
 }
 
 NS_IMPL_THREADSAFE_QUERY_INTERFACE2(nsHttpTransaction,
@@ -1723,17 +1723,17 @@ nsHttpTransaction::OnOutputStreamReady(n
 
 // nsHttpTransaction::RestartVerifier
 
 static bool
 matchOld(nsHttpResponseHead *newHead, nsCString &old,
          nsHttpAtom headerAtom)
 {
     const char *val;
-    
+
     val = newHead->PeekHeader(headerAtom);
     if (val && old.IsEmpty())
         return false;
     if (!val && !old.IsEmpty())
         return false;
     if (val && !old.Equals(val))
         return false;
     return true;
@@ -1758,17 +1758,17 @@ nsHttpTransaction::RestartVerifier::Veri
     if (!matchOld(newHead, mETag, nsHttp::ETag))
         return false;
 
     if (!matchOld(newHead, mContentEncoding, nsHttp::Content_Encoding))
         return false;
 
     if (!matchOld(newHead, mTransferEncoding, nsHttp::Transfer_Encoding))
         return false;
-    
+
     return true;
 }
 
 void
 nsHttpTransaction::RestartVerifier::Set(int64_t contentLength,
                                         nsHttpResponseHead *head)
 {
     if (mSetup)
@@ -1777,17 +1777,17 @@ nsHttpTransaction::RestartVerifier::Set(
     // If mSetup does not transition to true RestartInPogress() is later
     // forbidden
 
     // Only RestartInProgress with 200 response code
     if (head->Status() != 200)
         return;
 
     mContentLength = contentLength;
-    
+
     if (head) {
         const char *val;
         val = head->PeekHeader(nsHttp::ETag);
         if (val)
             mETag.Assign(val);
         val = head->PeekHeader(nsHttp::Last_Modified);
         if (val)
             mLastModified.Assign(val);
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -48,17 +48,17 @@ public:
     NS_DECL_NSIINPUTSTREAMCALLBACK
     NS_DECL_NSIOUTPUTSTREAMCALLBACK
 
     nsHttpTransaction();
     virtual ~nsHttpTransaction();
 
     //
     // called to initialize the transaction
-    // 
+    //
     // @param caps
     //        the transaction capabilities (see nsHttp.h)
     // @param connInfo
     //        the connection type for this transaction.
     // @param reqHeaders
     //        the request header struct
     // @param reqBody
     //        the request body (POST or PUT data stream)
@@ -110,17 +110,17 @@ public:
 
     void PrintDiagnostics(nsCString &log);
 
     // Sets mPendingTime to the current time stamp or to a null time stamp (if now is false)
     void SetPendingTime(bool now = true) { mPendingTime = now ? mozilla::TimeStamp::Now() : mozilla::TimeStamp(); }
     const mozilla::TimeStamp GetPendingTime() { return mPendingTime; }
     bool UsesPipelining() const { return mCaps & NS_HTTP_ALLOW_PIPELINING; }
 
-    void SetLoadGroupConnectionInfo(nsILoadGroupConnectionInfo *aLoadGroupCI) { mLoadGroupCI = aLoadGroupCI; } 
+    void SetLoadGroupConnectionInfo(nsILoadGroupConnectionInfo *aLoadGroupCI) { mLoadGroupCI = aLoadGroupCI; }
     nsILoadGroupConnectionInfo *LoadGroupConnectionInfo() { return mLoadGroupCI.get(); }
     void DispatchedAsBlocking();
     void RemoveDispatchedAsBlocking();
 
 private:
     nsresult Restart();
     nsresult RestartInProgress();
     char    *LocateHttpStart(char *buf, uint32_t len,
@@ -245,17 +245,17 @@ private:
 
     // protected by nsHttp::GetLock()
     nsHttpResponseHead             *mForTakeResponseHead;
     bool                            mResponseHeadTaken;
 
     // The time when the transaction was submitted to the Connection Manager
     mozilla::TimeStamp              mPendingTime;
 
-    class RestartVerifier 
+    class RestartVerifier
     {
 
         // When a idemptotent transaction has received part of its response body
         // and incurs an error it can be restarted. To do this we mark the place
         // where we stopped feeding the body to the consumer and start the
         // network call over again. If everything we track (headers, length, etc..)
         // matches up to the place where we left off then the consumer starts being
         // fed data again with the new information. This can be done N times up
@@ -264,17 +264,17 @@ private:
     public:
         RestartVerifier()
             : mContentLength(-1)
             , mAlreadyProcessed(0)
             , mToReadBeforeRestart(0)
             , mSetup(false)
         {}
         ~RestartVerifier() {}
-        
+
         void Set(int64_t contentLength, nsHttpResponseHead *head);
         bool Verify(int64_t contentLength, nsHttpResponseHead *head);
         bool IsDiscardingContent() { return mToReadBeforeRestart != 0; }
         bool IsSetup() { return mSetup; }
         int64_t AlreadyProcessed() { return mAlreadyProcessed; }
         void SetAlreadyProcessed(int64_t val) {
             mAlreadyProcessed = val;
             mToReadBeforeRestart = val;
--- a/netwerk/protocol/http/nsIHttpActivityObserver.idl
+++ b/netwerk/protocol/http/nsIHttpActivityObserver.idl
@@ -67,19 +67,19 @@ interface nsIHttpActivityObserver : nsIS
     const unsigned long ACTIVITY_SUBTYPE_RESPONSE_START    = 0x5003;
     const unsigned long ACTIVITY_SUBTYPE_RESPONSE_HEADER   = 0x5004;
     const unsigned long ACTIVITY_SUBTYPE_RESPONSE_COMPLETE = 0x5005;
     const unsigned long ACTIVITY_SUBTYPE_TRANSACTION_CLOSE = 0x5006;
 
     /**
      *  When aActivityType is ACTIVITY_TYPE_SOCKET_TRANSPORT
      *  and aActivitySubtype is STATUS_SENDING_TO
-     *  aExtraSizeData will contain the count of bytes sent 
+     *  aExtraSizeData will contain the count of bytes sent
      *  There may be more than one of these activities reported
-     *  for a single http transaction, each aExtraSizeData 
+     *  for a single http transaction, each aExtraSizeData
      *  represents only that portion of the total bytes sent
      *
      *  When aActivityType is ACTIVITY_TYPE_HTTP_TRANSACTION
      *  and aActivitySubtype is ACTIVITY_SUBTYPE_REQUEST_HEADER
      *  aExtraStringData will contain the text of the header
      *
      *  When aActivityType is ACTIVITY_TYPE_HTTP_TRANSACTION
      *  and aActivitySubtype is ACTIVITY_SUBTYPE_RESPONSE_HEADER
--- a/netwerk/protocol/http/nsIHttpAuthManager.idl
+++ b/netwerk/protocol/http/nsIHttpAuthManager.idl
@@ -5,17 +5,17 @@
 
 #include "nsISupports.idl"
 
 interface nsIPrincipal;
 
 /**
  * nsIHttpAuthManager
  *
- * This service provides access to cached HTTP authentication 
+ * This service provides access to cached HTTP authentication
  * user credentials (domain, username, password) for sites
  * visited during the current browser session.
  *
  * This interface exists to provide other HTTP stacks with the
  * ability to share HTTP authentication credentials with Necko.
  * This is currently used by the Java plugin (version 1.5 and
  * higher) to avoid duplicate authentication prompts when the
  * Java client fetches content from a HTTP site that the user
--- a/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
+++ b/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
@@ -12,17 +12,17 @@ interface nsIInterfaceRequestor;
 
 [scriptable, uuid(701093ac-5c7f-429c-99e3-423b041fccb4)]
 interface nsIHttpAuthenticableChannel : nsIProxiedChannel
 {
     /**
      * If the channel being authenticated is using SSL.
      */
     readonly attribute boolean isSSL;
-    
+
     /**
      * Returns if the proxy HTTP method used is CONNECT. If no proxy is being
      * used it must return PR_FALSE.
      */
     readonly attribute boolean proxyMethodIsConnect;
 
     /**
      * Cancels the current request. See nsIRequest.
@@ -67,17 +67,17 @@ interface nsIHttpAuthenticableChannel : 
     readonly attribute ACString proxyChallenges;
 
     /**
      * The WWW-Authenticate response header.
      */
     readonly attribute ACString WWWChallenges;
 
     /**
-     * Sets the Proxy-Authorization request header. An empty string 
+     * Sets the Proxy-Authorization request header. An empty string
      * will clear it.
      */
     void setProxyCredentials(in ACString credentials);
 
     /**
      * Sets the Authorization request header. An empty string
      * will clear it.
      */
--- a/netwerk/protocol/http/nsIHttpAuthenticator.idl
+++ b/netwerk/protocol/http/nsIHttpAuthenticator.idl
@@ -8,17 +8,17 @@
 interface nsIHttpAuthenticableChannel;
 
 /**
  * nsIHttpAuthenticator
  *
  * Interface designed to allow for pluggable HTTP authentication modules.
  * Implementations are registered under the ContractID:
  *
- *   "@mozilla.org/network/http-authenticator;1?scheme=<auth-scheme>"  
+ *   "@mozilla.org/network/http-authenticator;1?scheme=<auth-scheme>"
  *
  * where <auth-scheme> is the lower-cased value of the authentication scheme
  * found in the server challenge per the rules of RFC 2617.
  */
 [scriptable, uuid(16784db0-fcb1-4352-b0c9-6a3a67e3cf79)]
 interface nsIHttpAuthenticator : nsISupports
 {
     /**
@@ -99,17 +99,17 @@ interface nsIHttpAuthenticator : nsISupp
                                out   unsigned long  aFlags);
 
     /**
      * Generate flags
      */
 
     /**
      * Indicates that the authenticator has used an out-of-band or internal
-     * source of identity and tells the consumer that it must not cache 
+     * source of identity and tells the consumer that it must not cache
      * the returned identity because it might not be valid and would overwrite
      * the cached identity.  See bug 542318 comment 32.
      */
     const unsigned long USING_INTERNAL_IDENTITY = (1<<0);
 
     /**
      * Flags defining various properties of the authenticator.
      */
--- a/netwerk/protocol/http/nsIHttpChannel.idl
+++ b/netwerk/protocol/http/nsIHttpChannel.idl
@@ -37,17 +37,17 @@ interface nsIHttpChannel : nsIChannel
      * @throws NS_ERROR_IN_PROGRESS if set after the channel has been opened.
      */
     attribute ACString requestMethod;
 
     /**
      * Get/set the HTTP referrer URI.  This is the address (URI) of the
      * resource from which this channel's URI was obtained (see RFC2616 section
      * 14.36).
-     * 
+     *
      * This attribute may only be set before the channel is opened.
      *
      * NOTE: The channel may silently refuse to set the Referer header if the
      * URI does not pass certain security checks (e.g., a "https://" URL will
      * never be sent as the referrer for a plaintext HTTP request).  The
      * implementation is not required to throw an exception when the referrer
      * URI is rejected.
      *
@@ -210,17 +210,17 @@ interface nsIHttpChannel : nsIChannel
      *        values for the specified header.  This flag is ignored if the
      *        specified header does not support merging (e.g., the "Content-
      *        Type" header can only have one value).  The list of headers for
      *        which this flag is ignored is an implementation detail.  If this
      *        flag is false, then the header value will be replaced with the
      *        contents of |aValue|.
      *
      * If aValue is empty and aMerge is false, the header will be cleared.
-     * 
+     *
      * @throws NS_ERROR_NOT_AVAILABLE if called before the response
      *         has been received (before onStartRequest).
      * @throws NS_ERROR_ILLEGAL_VALUE if changing the value of this response
      *         header is not allowed.
      */
     void setResponseHeader(in ACString header,
                            in ACString value,
                            in boolean merge);
--- a/netwerk/protocol/http/nsIHttpChannelInternal.idl
+++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl
@@ -127,17 +127,17 @@ interface nsIHttpChannelInternal : nsISu
     /**
      * Transfer chain of redirected cache-keys.
      */
     [noscript] void setCacheKeysRedirectChain(in StringArray cacheKeys);
 
     /**
      * HTTPUpgrade allows for the use of HTTP to bootstrap another protocol
      * via the RFC 2616 Upgrade request header in conjunction with a 101 level
-     * response. The nsIHttpUpgradeListener will have its 
+     * response. The nsIHttpUpgradeListener will have its
      * onTransportAvailable() method invoked if a matching 101 is processed.
      * The arguments to onTransportAvailable provide the new protocol the low
      * level tranport streams that are no longer used by HTTP.
      *
      * The onStartRequest and onStopRequest events are still delivered and the
      * listener gets full control over the socket if and when onTransportAvailable
      * is delievered.
      *
--- a/netwerk/protocol/http/nsIHttpEventSink.idl
+++ b/netwerk/protocol/http/nsIHttpEventSink.idl
@@ -27,11 +27,11 @@ interface nsIURI;
 interface nsIHttpEventSink : nsISupports
 {
     /**
      * Called when a redirect occurs due to a HTTP response like 302.  The
      * redirection may be to a non-http channel.
      *
      * @return failure cancels redirect
      */
-    void onRedirect(in nsIHttpChannel httpChannel, 
+    void onRedirect(in nsIHttpChannel httpChannel,
                     in nsIChannel newChannel);
 };
--- a/netwerk/protocol/http/nsIHttpProtocolHandler.idl
+++ b/netwerk/protocol/http/nsIHttpProtocolHandler.idl
@@ -45,24 +45,24 @@ interface nsIHttpProtocolHandler : nsIPr
     /**
      * Get the application comment misc portion.
      */
     readonly attribute ACString misc;
 
 };
 
 %{C++
-// ----------- Categories ----------- 
+// ----------- Categories -----------
 /**
  * At initialization time, the HTTP handler will initialize each service
  * registered under this category:
  */
 #define NS_HTTP_STARTUP_CATEGORY "http-startup-category"
 
-// ----------- Observer topics ----------- 
+// ----------- Observer topics -----------
 /**
  * nsIObserver notification corresponding to startup category.  Services
  * registered under the startup category will receive this observer topic at
  * startup if they implement nsIObserver.  The "subject" of the notification
  * is the nsIHttpProtocolHandler instance.
  */
 #define NS_HTTP_STARTUP_TOPIC "http-startup"