Backed out changeset 8a25ee567449 (bug 938803)
authorWes Kocher <wkocher@mozilla.com>
Tue, 26 Nov 2013 19:44:30 -0600
changeset 157702 2739604442925ba1ca755886ee82faf484981531
parent 157701 41f0055dd60fa72f2385076916ddaa65da390eb5
child 157703 efa24f666f429e909582318d6fac54386f74c035
push id25719
push usercbook@mozilla.com
push dateWed, 27 Nov 2013 09:57:23 +0000
treeherdermozilla-central@2e3d89ed5dc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs938803
milestone28.0a1
backs out8a25ee567449a6bdbd7d041b1a69092cc0b6d810
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
Backed out changeset 8a25ee567449 (bug 938803)
netwerk/protocol/http/NullHttpTransaction.cpp
netwerk/protocol/http/NullHttpTransaction.h
netwerk/protocol/http/SpdyPush3.cpp
netwerk/protocol/http/SpdyPush31.cpp
netwerk/protocol/http/SpdySession3.cpp
netwerk/protocol/http/SpdySession31.cpp
netwerk/protocol/http/nsAHttpTransaction.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpPipeline.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
--- a/netwerk/protocol/http/NullHttpTransaction.cpp
+++ b/netwerk/protocol/http/NullHttpTransaction.cpp
@@ -17,17 +17,16 @@ namespace net {
 
 NS_IMPL_ISUPPORTS0(NullHttpTransaction)
 
 NullHttpTransaction::NullHttpTransaction(nsHttpConnectionInfo *ci,
                                          nsIInterfaceRequestor *callbacks,
                                          uint32_t caps)
   : mStatus(NS_OK)
   , mCaps(caps | NS_HTTP_ALLOW_KEEPALIVE)
-  , mCapsToClear(0)
   , mCallbacks(callbacks)
   , mConnectionInfo(ci)
   , mRequestHead(nullptr)
   , mIsDone(false)
 {
 }
 
 NullHttpTransaction::~NullHttpTransaction()
@@ -72,24 +71,17 @@ nsresult
 NullHttpTransaction::Status()
 {
   return mStatus;
 }
 
 uint32_t
 NullHttpTransaction::Caps()
 {
-  return mCaps & ~mCapsToClear;
-}
-
-void
-NullHttpTransaction::SetDNSWasRefreshed()
-{
-  MOZ_ASSERT(NS_IsMainThread(), "SetDNSWasRefreshed on main thread only!");
-  mCapsToClear |= NS_HTTP_REFRESH_DNS;
+  return mCaps;
 }
 
 uint64_t
 NullHttpTransaction::Available()
 {
   return 0;
 }
 
--- a/netwerk/protocol/http/NullHttpTransaction.h
+++ b/netwerk/protocol/http/NullHttpTransaction.h
@@ -36,22 +36,16 @@ public:
 
   // An overload of nsAHttpTransaction::IsNullTransaction()
   bool IsNullTransaction() { return true; }
 
 private:
 
   nsresult mStatus;
   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;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   nsRefPtr<nsHttpConnectionInfo> mConnectionInfo;
   nsHttpRequestHead *mRequestHead;
   bool mIsDone;
 };
 
 }} // namespace mozilla::net
--- a/netwerk/protocol/http/SpdyPush3.cpp
+++ b/netwerk/protocol/http/SpdyPush3.cpp
@@ -222,21 +222,16 @@ SpdyPush3TransactionBuffer::Status()
 }
 
 uint32_t
 SpdyPush3TransactionBuffer::Caps()
 {
   return 0;
 }
 
-void
-SpdyPush3TransactionBuffer::SetDNSWasRefreshed()
-{
-}
-
 uint64_t
 SpdyPush3TransactionBuffer::Available()
 {
   return mBufferedHTTP1Used - mBufferedHTTP1Consumed;
 }
 
 nsresult
 SpdyPush3TransactionBuffer::ReadSegments(nsAHttpSegmentReader *reader,
--- a/netwerk/protocol/http/SpdyPush31.cpp
+++ b/netwerk/protocol/http/SpdyPush31.cpp
@@ -220,21 +220,16 @@ SpdyPush31TransactionBuffer::Status()
 }
 
 uint32_t
 SpdyPush31TransactionBuffer::Caps()
 {
   return 0;
 }
 
-void
-SpdyPush31TransactionBuffer::SetDNSWasRefreshed()
-{
-}
-
 uint64_t
 SpdyPush31TransactionBuffer::Available()
 {
   return mBufferedHTTP1Used - mBufferedHTTP1Consumed;
 }
 
 nsresult
 SpdyPush31TransactionBuffer::ReadSegments(nsAHttpSegmentReader *reader,
--- a/netwerk/protocol/http/SpdySession3.cpp
+++ b/netwerk/protocol/http/SpdySession3.cpp
@@ -2573,21 +2573,16 @@ SpdySession3::Status()
 
 uint32_t
 SpdySession3::Caps()
 {
   MOZ_ASSERT(false, "SpdySession3::Caps()");
   return 0;
 }
 
-void
-SpdySession3::SetDNSWasRefreshed()
-{
-}
-
 uint64_t
 SpdySession3::Available()
 {
   MOZ_ASSERT(false, "SpdySession3::Available()");
   return 0;
 }
 
 nsHttpRequestHead *
--- a/netwerk/protocol/http/SpdySession31.cpp
+++ b/netwerk/protocol/http/SpdySession31.cpp
@@ -2697,21 +2697,16 @@ SpdySession31::Status()
 
 uint32_t
 SpdySession31::Caps()
 {
   MOZ_ASSERT(false, "SpdySession31::Caps()");
   return 0;
 }
 
-void
-SpdySession31::SetDNSWasRefreshed()
-{
-}
-
 uint64_t
 SpdySession31::Available()
 {
   MOZ_ASSERT(false, "SpdySession31::Available()");
   return 0;
 }
 
 nsHttpRequestHead *
--- a/netwerk/protocol/http/nsAHttpTransaction.h
+++ b/netwerk/protocol/http/nsAHttpTransaction.h
@@ -45,19 +45,16 @@ public:
     virtual void OnTransportStatus(nsITransport* transport,
                                    nsresult status, uint64_t progress) = 0;
 
     // called to check the transaction status.
     virtual bool     IsDone() = 0;
     virtual nsresult Status() = 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.
     virtual uint64_t Available() = 0;
 
     // called to read request data from the transaction.
     virtual nsresult ReadSegments(nsAHttpSegmentReader *reader,
                                   uint32_t count, uint32_t *countRead) = 0;
 
     // called to write response data to the transaction.
@@ -152,17 +149,16 @@ public:
     void SetConnection(nsAHttpConnection *); \
     nsAHttpConnection *Connection(); \
     void GetSecurityCallbacks(nsIInterfaceRequestor **);       \
     void OnTransportStatus(nsITransport* transport, \
                            nsresult status, uint64_t progress); \
     bool     IsDone(); \
     nsresult Status(); \
     uint32_t Caps();   \
-    void     SetDNSWasRefreshed(); \
     uint64_t Available(); \
     nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *); \
     nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *); \
     void     Close(nsresult reason);                                    \
     void     SetProxyConnectFailed();                                   \
     nsHttpRequestHead *RequestHead();                                   \
     uint32_t Http1xTransactionCount();                                  \
     nsresult TakeSubTransactions(nsTArray<nsRefPtr<nsAHttpTransaction> > &outTransactions); \
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5945,19 +5945,16 @@ nsHttpChannel::OnLookupComplete(nsICance
         mTransactionTimings.domainLookupEnd =
             mDNSPrefetch->EndTimestamp();
     }
     mDNSPrefetch = nullptr;
 
     // Unset DNS cache refresh if it was requested,
     if (mCaps & NS_HTTP_REFRESH_DNS) {
         mCaps &= ~NS_HTTP_REFRESH_DNS;
-        if (mTransaction) {
-            mTransaction->SetDNSWasRefreshed();
-        }
     }
 
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel internal functions
 //-----------------------------------------------------------------------------
--- a/netwerk/protocol/http/nsHttpPipeline.cpp
+++ b/netwerk/protocol/http/nsHttpPipeline.cpp
@@ -553,27 +553,16 @@ nsHttpPipeline::Caps()
 {
     nsAHttpTransaction *trans = Request(0);
     if (!trans)
         trans = Response(0);
 
     return trans ? trans->Caps() : 0;
 }
 
-void
-nsHttpPipeline::SetDNSWasRefreshed()
-{
-    nsAHttpTransaction *trans = Request(0);
-    if (!trans)
-        trans = Response(0);
-
-    if (trans)
-      trans->SetDNSWasRefreshed();
-}
-
 uint64_t
 nsHttpPipeline::Available()
 {
     uint64_t result = 0;
 
     int32_t i, count = mRequestQ.Length();
     for (i=0; i<count; ++i)
         result += Request(i)->Available();
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -93,17 +93,16 @@ nsHttpTransaction::nsHttpTransaction()
     , mContentLength(-1)
     , mContentRead(0)
     , mInvalidResponseBytesRead(0)
     , mChunkedDecoder(nullptr)
     , mStatus(NS_OK)
     , mPriority(0)
     , mRestartCount(0)
     , mCaps(0)
-    , mCapsToClear(0)
     , mClassification(CLASS_GENERAL)
     , mPipelinePosition(0)
     , mHttpVersion(NS_HTTP_VERSION_UNKNOWN)
     , mClosed(false)
     , mConnected(false)
     , mHaveStatusLine(false)
     , mHaveAllHeaders(false)
     , mTransactionDone(false)
@@ -548,24 +547,17 @@ nsresult
 nsHttpTransaction::Status()
 {
     return mStatus;
 }
 
 uint32_t
 nsHttpTransaction::Caps()
 {
-    return mCaps & ~mCapsToClear;
-}
-
-void
-nsHttpTransaction::SetDNSWasRefreshed()
-{
-    MOZ_ASSERT(NS_IsMainThread(), "SetDNSWasRefreshed on main thread only!");
-    mCapsToClear |= NS_HTTP_REFRESH_DNS;
+    return mCaps;
 }
 
 uint64_t
 nsHttpTransaction::Available()
 {
     uint64_t size;
     if (NS_FAILED(mRequestStream->Available(&size)))
         size = 0;
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -205,22 +205,16 @@ private:
     TimingStruct                    mTimings;
 
     nsresult                        mStatus;
 
     int16_t                         mPriority;
 
     uint16_t                        mRestartCount;        // the number of times this transaction has been restarted
     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;
     int32_t                         mPipelinePosition;
     int64_t                         mMaxPipelineObjectSize;
 
     nsHttpVersion                   mHttpVersion;
 
     // state flags, all logically boolean, but not packed together into a
     // bitfield so as to avoid bitfield-induced races.  See bug 560579.