Bug 558624 - e10s Cookies: Optimize implementation. Part 1. Clean up warning in http. r=dwitte. a=blocking-fennec

This commit is contained in:
Doug Turner
2010-10-01 15:18:55 -07:00
parent 56d73b72ed
commit b81cfd37f3
5 changed files with 25 additions and 12 deletions

View File

@@ -104,7 +104,10 @@ struct ParamTraits<URI>
nsCOMPtr<nsIClassInfo> classInfo = do_QueryInterface(aParam.mURI); nsCOMPtr<nsIClassInfo> classInfo = do_QueryInterface(aParam.mURI);
char cidStr[NSID_LENGTH]; char cidStr[NSID_LENGTH];
nsCID cid; 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"); NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "All IPDL URIs must report a valid class ID");
cid.ToProvidedString(cidStr); cid.ToProvidedString(cidStr);

View File

@@ -43,6 +43,7 @@
#include "mozilla/net/HttpChannelParent.h" #include "mozilla/net/HttpChannelParent.h"
#include "mozilla/dom/TabParent.h" #include "mozilla/dom/TabParent.h"
#include "mozilla/net/NeckoParent.h" #include "mozilla/net/NeckoParent.h"
#include "mozilla/unused.h"
#include "nsHttpChannel.h" #include "nsHttpChannel.h"
#include "nsHttpHandler.h" #include "nsHttpHandler.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
@@ -56,6 +57,8 @@
#include "nsIAssociatedContentSecurity.h" #include "nsIAssociatedContentSecurity.h"
#include "nsISecureBrowserUI.h" #include "nsISecureBrowserUI.h"
using mozilla::unused;
namespace mozilla { namespace mozilla {
namespace net { namespace net {
@@ -223,7 +226,8 @@ HttpChannelParentListener::AsyncOnChannelRedirect(
nsHttpResponseHead *responseHead = oldHttpChannel->GetResponseHead(); nsHttpResponseHead *responseHead = oldHttpChannel->GetResponseHead();
// TODO: check mActiveChannel->mIPCClosed and return val from Send function // TODO: check mActiveChannel->mIPCClosed and return val from Send function
mActiveChannel->SendRedirect1Begin(mRedirectChannel,
unused << mActiveChannel->SendRedirect1Begin(mRedirectChannel,
IPC::URI(newURI), IPC::URI(newURI),
redirectFlags, redirectFlags,
responseHead ? *responseHead responseHead ? *responseHead
@@ -269,7 +273,7 @@ HttpChannelParentListener::OnRedirectResult(PRBool succeeded)
if (succeeded && !mActiveChannel->mIPCClosed) { if (succeeded && !mActiveChannel->mIPCClosed) {
// TODO: check return value: assume child dead if failed // TODO: check return value: assume child dead if failed
mActiveChannel->SendRedirect3Complete(); unused << mActiveChannel->SendRedirect3Complete();
} }
HttpChannelParent* channelToDelete; HttpChannelParent* channelToDelete;
@@ -283,7 +287,7 @@ HttpChannelParentListener::OnRedirectResult(PRBool succeeded)
} }
if (!channelToDelete->mIPCClosed) if (!channelToDelete->mIPCClosed)
HttpChannelParent::Send__delete__(channelToDelete); unused << HttpChannelParent::Send__delete__(channelToDelete);
mRedirectChannel = nsnull; mRedirectChannel = nsnull;
return NS_OK; return NS_OK;

View File

@@ -214,7 +214,10 @@ struct ParamTraits<nsIStringInputStream*>
NS_ASSERTION(value.Length() == length, "SetLength failed"); NS_ASSERTION(value.Length() == length, "SetLength failed");
char *c = value.BeginWriting(); char *c = value.BeginWriting();
PRUint32 bytesRead; 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"); NS_ASSERTION(NS_SUCCEEDED(rv) && bytesRead == length, "Read failed");
} }

View File

@@ -415,7 +415,7 @@ nsHttpAuthEntry::Set(const char *path,
memcpy(newChall, chall, challLen); memcpy(newChall, chall, challLen);
newChall[challLen] = 0; newChall[challLen] = 0;
nsresult rv; nsresult rv = NS_OK;
if (ident) { if (ident) {
rv = mIdent.Set(*ident); rv = mIdent.Set(*ident);
} }

View File

@@ -3878,7 +3878,7 @@ nsHttpChannel::ContinueOnStartRequest2(nsresult result)
if (NS_FAILED(mStatus)) { if (NS_FAILED(mStatus)) {
PushRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest3); PushRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest3);
PRBool waitingForRedirectCallback; PRBool waitingForRedirectCallback;
nsresult rv = ProcessFallback(&waitingForRedirectCallback); ProcessFallback(&waitingForRedirectCallback);
if (waitingForRedirectCallback) if (waitingForRedirectCallback)
return NS_OK; return NS_OK;
PopRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest3); PopRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest3);
@@ -4585,7 +4585,10 @@ nsHttpChannel::WaitForRedirectCallback()
if (mCachePump) { if (mCachePump) {
rv = mCachePump->Suspend(); rv = mCachePump->Suspend();
if (NS_FAILED(rv) && mTransactionPump) { if (NS_FAILED(rv) && mTransactionPump) {
nsresult resume = mTransactionPump->Resume(); #ifdef DEBUG
nsresult resume =
#endif
mTransactionPump->Resume();
NS_ASSERTION(NS_SUCCEEDED(resume), NS_ASSERTION(NS_SUCCEEDED(resume),
"Failed to resume transaction pump"); "Failed to resume transaction pump");
} }