Bug 1522786 - Remove unused class member mHasQueryString r=mayhemer
authorKershaw Chang <kershaw@mozilla.com>
Wed, 06 Feb 2019 18:16:59 +0000
changeset 457477 de51545099a617602be187d1c0f68ff2a87d6fb2
parent 457476 d5850db1fb0dcee10fa18195594010a3f1e662b1
child 457478 dacb06f05d5b8dfa787a0cabd08ff56b61151afc
child 457482 1d1421bf2ade2fd7ae3a90b29a6ede6433ba923b
push id111729
push userrgurzau@mozilla.com
push dateWed, 06 Feb 2019 22:00:03 +0000
treeherdermozilla-inbound@dacb06f05d5b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1522786
milestone67.0a1
first release with
nightly linux32
de51545099a6 / 67.0a1 / 20190206215551 / files
nightly linux64
de51545099a6 / 67.0a1 / 20190206215551 / files
nightly mac
de51545099a6 / 67.0a1 / 20190206215551 / files
nightly win32
de51545099a6 / 67.0a1 / 20190206215551 / files
nightly win64
de51545099a6 / 67.0a1 / 20190206215551 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522786 - Remove unused class member mHasQueryString r=mayhemer Simply remove unused class member mHasQueryString and HasQueryString() method. Differential Revision: https://phabricator.services.mozilla.com/D18694
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -314,17 +314,16 @@ nsHttpChannel::nsHttpChannel()
       mFallbackChannel(false),
       mCustomConditionalRequest(false),
       mFallingBack(false),
       mWaitingForRedirectCallback(false),
       mRequestTimeInitialized(false),
       mCacheEntryIsReadOnly(false),
       mCacheEntryIsWriteOnly(false),
       mCacheEntriesToWaitFor(0),
-      mHasQueryString(0),
       mConcurrentCacheAccess(0),
       mIsPartialRequest(0),
       mHasAutoRedirectVetoNotifier(0),
       mPinCacheContent(0),
       mIsCorsPreflightDone(0),
       mStronglyFramed(false),
       mUsedNetwork(0),
       mAuthConnectionRestartable(0),
@@ -3741,17 +3740,16 @@ static bool IsSubRangeRequest(nsHttpRequ
   return !byteRange.EqualsLiteral("bytes=0-");
 }
 
 nsresult nsHttpChannel::OpenCacheEntry(bool isHttps) {
   // Drop this flag here
   mConcurrentCacheAccess = 0;
 
   mLoadedFromApplicationCache = false;
-  mHasQueryString = HasQueryString(mRequestHead.ParsedMethod(), mURI);
 
   LOG(("nsHttpChannel::OpenCacheEntry [this=%p]", this));
 
   // make sure we're not abusing this function
   MOZ_ASSERT(!mCacheEntry, "cache entry already open");
 
   if (mRequestHead.IsPost()) {
     // If the post id is already set then this is an attempt to replay
@@ -4772,32 +4770,16 @@ nsresult nsHttpChannel::UpdateExpiration
   if (mOfflineCacheEntry) {
     rv = mOfflineCacheEntry->SetExpirationTime(expirationTime);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
-/*static*/ inline bool nsHttpChannel::HasQueryString(
-    nsHttpRequestHead::ParsedMethodType method, nsIURI *uri) {
-  // Must be called on the main thread because nsIURI does not implement
-  // thread-safe QueryInterface.
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (method != nsHttpRequestHead::kMethod_Get &&
-      method != nsHttpRequestHead::kMethod_Head)
-    return false;
-
-  nsAutoCString query;
-  nsCOMPtr<nsIURL> url = do_QueryInterface(uri);
-  nsresult rv = url->GetQuery(query);
-  return NS_SUCCEEDED(rv) && !query.IsEmpty();
-}
-
 bool nsHttpChannel::ShouldUpdateOfflineCacheEntry() {
   if (!mApplicationCacheForWrite || !mOfflineCacheEntry) {
     return false;
   }
 
   // if we're updating the cache entry, update the offline cache entry too
   if (mCacheEntry && mCacheEntryIsWriteOnly) {
     return true;
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -650,17 +650,16 @@ class nsHttpChannel final : public HttpB
   uint32_t mWaitingForRedirectCallback : 1;
   // True if mRequestTime has been set. In such a case it is safe to update
   // the cache entry's expiration time. Otherwise, it is not(see bug 567360).
   uint32_t mRequestTimeInitialized : 1;
   uint32_t mCacheEntryIsReadOnly : 1;
   uint32_t mCacheEntryIsWriteOnly : 1;
   // see WAIT_FOR_* constants above
   uint32_t mCacheEntriesToWaitFor : 2;
-  uint32_t mHasQueryString : 1;
   // whether cache entry data write was in progress during cache entry check
   // when true, after we finish read from cache we must check all data
   // had been loaded from cache. If not, then an error has to be propagated
   // to the consumer.
   uint32_t mConcurrentCacheAccess : 1;
   // whether the request is setup be byte-range
   uint32_t mIsPartialRequest : 1;
   // true iff there is AutoRedirectVetoNotifier on the stack