Bug 512518 followup: fix 'unused variable' warnings in nsRegressionTester.cpp, and use & instead of && for bit-masking operation. r=dbaron

This commit is contained in:
Daniel Holbert 2010-03-17 21:41:34 -07:00
parent b96097a2d0
commit 475462560c

View file

@ -81,27 +81,30 @@ nsRegressionTester::~nsRegressionTester()
NS_IMPL_ISUPPORTS1(nsRegressionTester, nsILayoutRegressionTester) NS_IMPL_ISUPPORTS1(nsRegressionTester, nsILayoutRegressionTester)
NS_IMETHODIMP NS_IMETHODIMP
nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump, nsILocalFile *aDestFile, PRUint32 aFlagsMask, PRInt32 *aResult) nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump,
nsILocalFile *aDestFile,
PRUint32 aFlagsMask, PRInt32 *aResult)
{ {
NS_ENSURE_ARG(aWindowToDump); NS_ENSURE_ARG(aWindowToDump);
NS_ENSURE_ARG_POINTER(aResult); NS_ENSURE_ARG_POINTER(aResult);
nsresult rv = NS_ERROR_NOT_AVAILABLE;
PRUint32 busyFlags;
PRBool stillLoading;
*aResult = DUMP_RESULT_ERROR; *aResult = DUMP_RESULT_ERROR;
#ifndef DEBUG #ifndef DEBUG
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
#else #else
nsresult rv = NS_ERROR_NOT_AVAILABLE;
PRUint32 busyFlags;
PRBool stillLoading;
nsCOMPtr<nsIDocShell> docShell; nsCOMPtr<nsIDocShell> docShell;
rv = GetDocShellFromWindow(aWindowToDump, getter_AddRefs(docShell)); rv = GetDocShellFromWindow(aWindowToDump, getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
// find out if the document is loaded // find out if the document is loaded
docShell->GetBusyFlags(&busyFlags); docShell->GetBusyFlags(&busyFlags);
stillLoading = busyFlags && (nsIDocShell::BUSY_FLAGS_BUSY | nsIDocShell::BUSY_FLAGS_PAGE_LOADING); stillLoading = busyFlags & (nsIDocShell::BUSY_FLAGS_BUSY |
nsIDocShell::BUSY_FLAGS_PAGE_LOADING);
if (stillLoading) if (stillLoading)
{ {
*aResult = DUMP_RESULT_LOADING; *aResult = DUMP_RESULT_LOADING;