Backed out changeset 8a25ee567449 (bug 938803)

This commit is contained in:
Wes Kocher 2013-11-26 19:44:30 -06:00
Родитель 12db2a480c
Коммит 6c5b337fd8
11 изменённых файлов: 2 добавлений и 68 удалений

Просмотреть файл

@ -22,7 +22,6 @@ NullHttpTransaction::NullHttpTransaction(nsHttpConnectionInfo *ci,
uint32_t caps) uint32_t caps)
: mStatus(NS_OK) : mStatus(NS_OK)
, mCaps(caps | NS_HTTP_ALLOW_KEEPALIVE) , mCaps(caps | NS_HTTP_ALLOW_KEEPALIVE)
, mCapsToClear(0)
, mCallbacks(callbacks) , mCallbacks(callbacks)
, mConnectionInfo(ci) , mConnectionInfo(ci)
, mRequestHead(nullptr) , mRequestHead(nullptr)
@ -77,14 +76,7 @@ NullHttpTransaction::Status()
uint32_t uint32_t
NullHttpTransaction::Caps() NullHttpTransaction::Caps()
{ {
return mCaps & ~mCapsToClear; return mCaps;
}
void
NullHttpTransaction::SetDNSWasRefreshed()
{
MOZ_ASSERT(NS_IsMainThread(), "SetDNSWasRefreshed on main thread only!");
mCapsToClear |= NS_HTTP_REFRESH_DNS;
} }
uint64_t uint64_t

Просмотреть файл

@ -41,12 +41,6 @@ private:
nsresult mStatus; nsresult mStatus;
uint32_t mCaps; uint32_t mCaps;
// mCapsToClear holds flags that should be cleared in mCaps, e.g. unset
// NS_HTTP_REFRESH_DNS when DNS refresh request has completed to avoid
// redundant requests on the network. To deal with raciness, only unsetting
// bitfields should be allowed: 'lost races' will thus err on the
// conservative side, e.g. by going ahead with a 2nd DNS refresh.
uint32_t mCapsToClear;
nsRefPtr<nsAHttpConnection> mConnection; nsRefPtr<nsAHttpConnection> mConnection;
nsCOMPtr<nsIInterfaceRequestor> mCallbacks; nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
nsRefPtr<nsHttpConnectionInfo> mConnectionInfo; nsRefPtr<nsHttpConnectionInfo> mConnectionInfo;

Просмотреть файл

@ -227,11 +227,6 @@ SpdyPush3TransactionBuffer::Caps()
return 0; return 0;
} }
void
SpdyPush3TransactionBuffer::SetDNSWasRefreshed()
{
}
uint64_t uint64_t
SpdyPush3TransactionBuffer::Available() SpdyPush3TransactionBuffer::Available()
{ {

Просмотреть файл

@ -225,11 +225,6 @@ SpdyPush31TransactionBuffer::Caps()
return 0; return 0;
} }
void
SpdyPush31TransactionBuffer::SetDNSWasRefreshed()
{
}
uint64_t uint64_t
SpdyPush31TransactionBuffer::Available() SpdyPush31TransactionBuffer::Available()
{ {

Просмотреть файл

@ -2578,11 +2578,6 @@ SpdySession3::Caps()
return 0; return 0;
} }
void
SpdySession3::SetDNSWasRefreshed()
{
}
uint64_t uint64_t
SpdySession3::Available() SpdySession3::Available()
{ {

Просмотреть файл

@ -2702,11 +2702,6 @@ SpdySession31::Caps()
return 0; return 0;
} }
void
SpdySession31::SetDNSWasRefreshed()
{
}
uint64_t uint64_t
SpdySession31::Available() SpdySession31::Available()
{ {

Просмотреть файл

@ -50,9 +50,6 @@ public:
virtual nsresult Status() = 0; virtual nsresult Status() = 0;
virtual uint32_t Caps() = 0; virtual uint32_t Caps() = 0;
// called to notify that a requested DNS cache entry was refreshed.
virtual void SetDNSWasRefreshed() = 0;
// called to find out how much request data is available for writing. // called to find out how much request data is available for writing.
virtual uint64_t Available() = 0; virtual uint64_t Available() = 0;
@ -157,7 +154,6 @@ public:
bool IsDone(); \ bool IsDone(); \
nsresult Status(); \ nsresult Status(); \
uint32_t Caps(); \ uint32_t Caps(); \
void SetDNSWasRefreshed(); \
uint64_t Available(); \ uint64_t Available(); \
nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *); \ nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *); \
nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *); \ nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *); \

Просмотреть файл

@ -5950,9 +5950,6 @@ nsHttpChannel::OnLookupComplete(nsICancelable *request,
// Unset DNS cache refresh if it was requested, // Unset DNS cache refresh if it was requested,
if (mCaps & NS_HTTP_REFRESH_DNS) { if (mCaps & NS_HTTP_REFRESH_DNS) {
mCaps &= ~NS_HTTP_REFRESH_DNS; mCaps &= ~NS_HTTP_REFRESH_DNS;
if (mTransaction) {
mTransaction->SetDNSWasRefreshed();
}
} }
return NS_OK; return NS_OK;

Просмотреть файл

@ -558,17 +558,6 @@ nsHttpPipeline::Caps()
return trans ? trans->Caps() : 0; return trans ? trans->Caps() : 0;
} }
void
nsHttpPipeline::SetDNSWasRefreshed()
{
nsAHttpTransaction *trans = Request(0);
if (!trans)
trans = Response(0);
if (trans)
trans->SetDNSWasRefreshed();
}
uint64_t uint64_t
nsHttpPipeline::Available() nsHttpPipeline::Available()
{ {

Просмотреть файл

@ -98,7 +98,6 @@ nsHttpTransaction::nsHttpTransaction()
, mPriority(0) , mPriority(0)
, mRestartCount(0) , mRestartCount(0)
, mCaps(0) , mCaps(0)
, mCapsToClear(0)
, mClassification(CLASS_GENERAL) , mClassification(CLASS_GENERAL)
, mPipelinePosition(0) , mPipelinePosition(0)
, mHttpVersion(NS_HTTP_VERSION_UNKNOWN) , mHttpVersion(NS_HTTP_VERSION_UNKNOWN)
@ -553,14 +552,7 @@ nsHttpTransaction::Status()
uint32_t uint32_t
nsHttpTransaction::Caps() nsHttpTransaction::Caps()
{ {
return mCaps & ~mCapsToClear; return mCaps;
}
void
nsHttpTransaction::SetDNSWasRefreshed()
{
MOZ_ASSERT(NS_IsMainThread(), "SetDNSWasRefreshed on main thread only!");
mCapsToClear |= NS_HTTP_REFRESH_DNS;
} }
uint64_t uint64_t

Просмотреть файл

@ -210,12 +210,6 @@ private:
uint16_t mRestartCount; // the number of times this transaction has been restarted uint16_t mRestartCount; // the number of times this transaction has been restarted
uint32_t mCaps; uint32_t mCaps;
// mCapsToClear holds flags that should be cleared in mCaps, e.g. unset
// NS_HTTP_REFRESH_DNS when DNS refresh request has completed to avoid
// redundant requests on the network. To deal with raciness, only unsetting
// bitfields should be allowed: 'lost races' will thus err on the
// conservative side, e.g. by going ahead with a 2nd DNS refresh.
uint32_t mCapsToClear;
enum Classifier mClassification; enum Classifier mClassification;
int32_t mPipelinePosition; int32_t mPipelinePosition;
int64_t mMaxPipelineObjectSize; int64_t mMaxPipelineObjectSize;