Bug 558624 - e10s Cookies: Optimize implementation. Part 1. Clean up warning in http. r=dwitte. a=blocking-fennec
authorDoug Turner <dougt@dougt.org>
Fri, 01 Oct 2010 15:18:55 -0700
changeset 54892 7a1028b9d42ffd7ec79595dfdcbf9e399dceeaf6
parent 54891 861afa477ababd8b80b398e9eb3bd1ba30d1e199
child 54893 25b8cd0b27678853bd1aa229f302cc5051014ac7
push id16062
push userdougt@mozilla.com
push dateSat, 02 Oct 2010 04:18:36 +0000
treeherdermozilla-central@0a7f37d28f7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwitte, blocking-fennec
bugs558624
milestone2.0b7pre
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 558624 - e10s Cookies: Optimize implementation. Part 1. Clean up warning in http. r=dwitte. a=blocking-fennec
netwerk/ipc/NeckoMessageUtils.h
netwerk/protocol/http/HttpChannelParentListener.cpp
netwerk/protocol/http/PHttpChannelParams.h
netwerk/protocol/http/nsHttpAuthCache.cpp
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -99,17 +99,20 @@ struct ParamTraits<URI>
       WriteParam(aMsg, spec);
       WriteParam(aMsg, charset);
       return;
     }
     
     nsCOMPtr<nsIClassInfo> classInfo = do_QueryInterface(aParam.mURI);
     char cidStr[NSID_LENGTH];
     nsCID cid;
-    nsresult rv = classInfo->GetClassIDNoAlloc(&cid);
+#ifdef DEBUG
+    nsresult rv =
+#endif
+    classInfo->GetClassIDNoAlloc(&cid);
     NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "All IPDL URIs must report a valid class ID");
     
     cid.ToProvidedString(cidStr);
     WriteParam(aMsg, nsCAutoString(cidStr));
     serializable->Write(aMsg);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -38,29 +38,32 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "HttpChannelParentListener.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/net/NeckoParent.h"
+#include "mozilla/unused.h"
 #include "nsHttpChannel.h"
 #include "nsHttpHandler.h"
 #include "nsNetUtil.h"
 #include "nsISupportsPriority.h"
 #include "nsIAuthPromptProvider.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIBadCertListener2.h"
 #include "nsICacheEntryDescriptor.h"
 #include "nsSerializationHelper.h"
 #include "nsISerializable.h"
 #include "nsIAssociatedContentSecurity.h"
 #include "nsISecureBrowserUI.h"
 
+using mozilla::unused;
+
 namespace mozilla {
 namespace net {
 
 HttpChannelParentListener::HttpChannelParentListener(HttpChannelParent* aInitialChannel)
   : mActiveChannel(aInitialChannel)
 {
 }
 
@@ -218,21 +221,22 @@ HttpChannelParentListener::AsyncOnChanne
 
   nsCOMPtr<nsIURI> newURI;
   newChannel->GetURI(getter_AddRefs(newURI));
 
   nsHttpChannel *oldHttpChannel = static_cast<nsHttpChannel *>(oldChannel);
   nsHttpResponseHead *responseHead = oldHttpChannel->GetResponseHead();
 
   // TODO: check mActiveChannel->mIPCClosed and return val from Send function
-  mActiveChannel->SendRedirect1Begin(mRedirectChannel,
-                                     IPC::URI(newURI),
-                                     redirectFlags,
-                                     responseHead ? *responseHead 
-                                                  : nsHttpResponseHead());
+  
+  unused << mActiveChannel->SendRedirect1Begin(mRedirectChannel,
+                                               IPC::URI(newURI),
+                                               redirectFlags,
+                                               responseHead ? *responseHead 
+                                                            : nsHttpResponseHead());
 
   // mActiveChannel gets the response in RecvRedirect2Result and forwards it
   // to this wrapper through OnContentRedirectResultReceived
 
   return NS_OK;
 }
 
 void
@@ -264,29 +268,29 @@ HttpChannelParentListener::OnRedirectRes
 {
   if (!mRedirectChannel) {
     // Redirect might get canceled before we got AsyncOnChannelRedirect
     return NS_OK;
   }
 
   if (succeeded && !mActiveChannel->mIPCClosed) {
     // TODO: check return value: assume child dead if failed
-    mActiveChannel->SendRedirect3Complete();
+    unused << mActiveChannel->SendRedirect3Complete();
   }
 
   HttpChannelParent* channelToDelete;
   if (succeeded) {
     // Switch to redirect channel and delete the old one.
     channelToDelete = mActiveChannel;
     mActiveChannel = mRedirectChannel;
   } else {
     // Delete the redirect target channel: continue using old channel
     channelToDelete = mRedirectChannel;
   }
 
   if (!channelToDelete->mIPCClosed)
-    HttpChannelParent::Send__delete__(channelToDelete);
+    unused << HttpChannelParent::Send__delete__(channelToDelete);
   mRedirectChannel = nsnull;
 
   return NS_OK;
 }
 
 }} // mozilla::net
--- a/netwerk/protocol/http/PHttpChannelParams.h
+++ b/netwerk/protocol/http/PHttpChannelParams.h
@@ -209,17 +209,20 @@ struct ParamTraits<nsIStringInputStream*
       cstr->GetData(value);
     } else {
       PRUint32 length;
       aParam->Available(&length);
       value.SetLength(length);
       NS_ASSERTION(value.Length() == length, "SetLength failed");
       char *c = value.BeginWriting();
       PRUint32 bytesRead;
-      nsresult rv = aParam->Read(c, length, &bytesRead);
+#ifdef DEBUG
+      nsresult rv = 
+#endif
+      aParam->Read(c, length, &bytesRead);
       NS_ASSERTION(NS_SUCCEEDED(rv) && bytesRead == length, "Read failed");
     }
 
     WriteParam(aMsg, value);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
--- a/netwerk/protocol/http/nsHttpAuthCache.cpp
+++ b/netwerk/protocol/http/nsHttpAuthCache.cpp
@@ -410,17 +410,17 @@ nsHttpAuthEntry::Set(const char *path,
         memcpy(newCreds, creds, credsLen);
     newCreds[credsLen] = 0;
 
     newChall = &newCreds[credsLen + 1];
     if (chall)
         memcpy(newChall, chall, challLen);
     newChall[challLen] = 0;
 
-    nsresult rv;
+    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.
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3873,17 +3873,17 @@ nsHttpChannel::ContinueOnStartRequest1(n
 
 nsresult
 nsHttpChannel::ContinueOnStartRequest2(nsresult result)
 {
     // on other request errors, try to fall back
     if (NS_FAILED(mStatus)) {
         PushRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest3);
         PRBool waitingForRedirectCallback;
-        nsresult rv = ProcessFallback(&waitingForRedirectCallback);
+        ProcessFallback(&waitingForRedirectCallback);
         if (waitingForRedirectCallback)
             return NS_OK;
         PopRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest3);
     }
 
     return ContinueOnStartRequest3(NS_OK);
 }
 
@@ -4580,17 +4580,20 @@ nsHttpChannel::WaitForRedirectCallback()
 
     if (mTransactionPump) {
         rv = mTransactionPump->Suspend();
         NS_ENSURE_SUCCESS(rv, rv);
     }
     if (mCachePump) {
         rv = mCachePump->Suspend();
         if (NS_FAILED(rv) && mTransactionPump) {
-            nsresult resume = mTransactionPump->Resume();
+#ifdef DEBUG
+            nsresult resume = 
+#endif
+            mTransactionPump->Resume();
             NS_ASSERTION(NS_SUCCEEDED(resume),
                 "Failed to resume transaction pump");
         }
         NS_ENSURE_SUCCESS(rv, rv);
     }
 
     mWaitingForRedirectCallback = PR_TRUE;
     return NS_OK;