Bug 1460313 - Remove unused mForTakeResponseHead. r?mcmanus
MozReview-Commit-ID: BIJvKrEeKiV
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -128,17 +128,16 @@ nsHttpTransaction::nsHttpTransaction()
, mForceRestart(false)
, mReuseOnRestart(false)
, mContentDecoding(false)
, mContentDecodingCheck(false)
, mDeferredSendProgress(false)
, mWaitingOnPipeOut(false)
, mReportedStart(false)
, mReportedResponseHeader(false)
- , mForTakeResponseHead(nullptr)
, mResponseHeadTaken(false)
, mForTakeResponseTrailers(nullptr)
, mResponseTrailersTaken(false)
, mTopLevelOuterContentWindowId(0)
, mSubmittedRatePacing(false)
, mPassedRatePacing(false)
, mSynchronousRatePaceRequest(false)
, mClassOfService(0)
@@ -225,17 +224,16 @@ nsHttpTransaction::~nsHttpTransaction()
mTokenBucketCancel = nullptr;
}
// Force the callbacks and connection to be released right now
mCallbacks = nullptr;
mConnection = nullptr;
delete mResponseHead;
- delete mForTakeResponseHead;
delete mChunkedDecoder;
ReleaseBlockingTransaction();
}
nsresult
nsHttpTransaction::Init(uint32_t caps,
nsHttpConnectionInfo *cinfo,
nsHttpRequestHead *requestHead,
@@ -462,33 +460,24 @@ nsHttpTransaction::TakeResponseHead()
{
MOZ_ASSERT(!mResponseHeadTaken, "TakeResponseHead called 2x");
// Lock TakeResponseHead() against main thread
MutexAutoLock lock(*nsHttp::GetLock());
mResponseHeadTaken = true;
- // 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;
+ nsHttpResponseHead *head = mResponseHead;
mResponseHead = nullptr;
return head;
}
nsHttpHeaderArray *
nsHttpTransaction::TakeResponseTrailers()
{
MOZ_ASSERT(!mResponseTrailersTaken, "TakeResponseTrailers called 2x");
@@ -628,17 +617,17 @@ nsHttpTransaction::OnTransportStatus(nsI
TimeStamp tnow = TimeStamp::Now();
SetConnectEnd(tnow, true);
{
MutexAutoLock lock(mLock);
mTimings.tcpConnectEnd = tnow;
// After a socket is connected we know for sure whether data
// has been sent on SYN packet and if not we should update TLS
// start timing.
- if ((mFastOpenStatus != TFO_DATA_SENT) &&
+ if ((mFastOpenStatus != TFO_DATA_SENT) &&
!mTimings.secureConnectionStart.IsNull()) {
mTimings.secureConnectionStart = tnow;
}
}
} else if (status == NS_NET_STATUS_TLS_HANDSHAKE_STARTING) {
{
MutexAutoLock lock(mLock);
mTimings.secureConnectionStart = TimeStamp::Now();
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -376,17 +376,16 @@ private:
// mTransactionDone := transaction ran to completion or was interrupted
// mResponseComplete := transaction ran to completion
// For Restart-In-Progress Functionality
bool mReportedStart;
bool mReportedResponseHeader;
// protected by nsHttp::GetLock()
- nsHttpResponseHead *mForTakeResponseHead;
bool mResponseHeadTaken;
nsAutoPtr<nsHttpHeaderArray> mForTakeResponseTrailers;
bool mResponseTrailersTaken;
// The time when the transaction was submitted to the Connection Manager
TimeStamp mPendingTime;
uint64_t mTopLevelOuterContentWindowId;