Bug 1218258 - Fix -Wshadow warnings in toolkit/components/downloads. r=paolo

toolkit/components/downloads/ApplicationReputation.cpp:598:14 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/ApplicationReputation.cpp:721:15 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/ApplicationReputation.cpp:809:29 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/nsDownloadManager.cpp:1268:36 [-Wshadow] declaration shadows a local variable
toolkit/components/downloads/nsDownloadManager.cpp:1483:33 [-Wshadow] declaration shadows a local variable
This commit is contained in:
Chris Peterson 2015-10-19 20:07:52 -07:00
Родитель 130d29b641
Коммит e61e4b918a
2 изменённых файлов: 20 добавлений и 23 удалений

Просмотреть файл

@ -596,7 +596,7 @@ PendingLookup::GenerateWhitelistStringsForChain(
aChain.element(i).certificate().size(), getter_AddRefs(issuer)); aChain.element(i).certificate().size(), getter_AddRefs(issuer));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsresult rv = GenerateWhitelistStringsForPair(signer, issuer); rv = GenerateWhitelistStringsForPair(signer, issuer);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
} }
return NS_OK; return NS_OK;
@ -706,24 +706,24 @@ PendingLookup::DoLookupInternal()
nsresult rv = mQuery->GetSourceURI(getter_AddRefs(uri)); nsresult rv = mQuery->GetSourceURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCString spec; nsCString sourceSpec;
rv = GetStrippedSpec(uri, spec); rv = GetStrippedSpec(uri, sourceSpec);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mAnylistSpecs.AppendElement(spec); mAnylistSpecs.AppendElement(sourceSpec);
ClientDownloadRequest_Resource* resource = mRequest.add_resources(); ClientDownloadRequest_Resource* resource = mRequest.add_resources();
resource->set_url(spec.get()); resource->set_url(sourceSpec.get());
resource->set_type(ClientDownloadRequest::DOWNLOAD_URL); resource->set_type(ClientDownloadRequest::DOWNLOAD_URL);
nsCOMPtr<nsIURI> referrer = nullptr; nsCOMPtr<nsIURI> referrer = nullptr;
rv = mQuery->GetReferrerURI(getter_AddRefs(referrer)); rv = mQuery->GetReferrerURI(getter_AddRefs(referrer));
if (referrer) { if (referrer) {
nsCString spec; nsCString referrerSpec;
rv = GetStrippedSpec(referrer, spec); rv = GetStrippedSpec(referrer, referrerSpec);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mAnylistSpecs.AppendElement(spec); mAnylistSpecs.AppendElement(referrerSpec);
resource->set_referrer(spec.get()); resource->set_referrer(referrerSpec.get());
} }
nsCOMPtr<nsIArray> redirects; nsCOMPtr<nsIArray> redirects;
rv = mQuery->GetRedirects(getter_AddRefs(redirects)); rv = mQuery->GetRedirects(getter_AddRefs(redirects));
@ -790,11 +790,11 @@ PendingLookup::ParseCertificates(nsIArray* aSigArray)
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
while (hasMoreChains) { while (hasMoreChains) {
nsCOMPtr<nsISupports> supports; nsCOMPtr<nsISupports> chainSupports;
rv = chains->GetNext(getter_AddRefs(supports)); rv = chains->GetNext(getter_AddRefs(chainSupports));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIX509CertList> certList = do_QueryInterface(supports, &rv); nsCOMPtr<nsIX509CertList> certList = do_QueryInterface(chainSupports, &rv);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
safe_browsing::ClientDownloadRequest_CertificateChain* certChain = safe_browsing::ClientDownloadRequest_CertificateChain* certChain =
@ -807,11 +807,11 @@ PendingLookup::ParseCertificates(nsIArray* aSigArray)
bool hasMoreCerts = false; bool hasMoreCerts = false;
rv = chainElt->HasMoreElements(&hasMoreCerts); rv = chainElt->HasMoreElements(&hasMoreCerts);
while (hasMoreCerts) { while (hasMoreCerts) {
nsCOMPtr<nsISupports> supports; nsCOMPtr<nsISupports> certSupports;
rv = chainElt->GetNext(getter_AddRefs(supports)); rv = chainElt->GetNext(getter_AddRefs(certSupports));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIX509Cert> cert = do_QueryInterface(supports, &rv); nsCOMPtr<nsIX509Cert> cert = do_QueryInterface(certSupports, &rv);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
uint8_t* data = nullptr; uint8_t* data = nullptr;

Просмотреть файл

@ -1274,17 +1274,17 @@ nsDownloadManager::GetDownloadFromDB(mozIStorageConnection* aDBConn,
if (dl->mGUID.IsEmpty()) { if (dl->mGUID.IsEmpty()) {
rv = GenerateGUID(dl->mGUID); rv = GenerateGUID(dl->mGUID);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<mozIStorageStatement> stmt; nsCOMPtr<mozIStorageStatement> updateStmt;
rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING(
"UPDATE moz_downloads SET guid = :guid " "UPDATE moz_downloads SET guid = :guid "
"WHERE id = :id"), "WHERE id = :id"),
getter_AddRefs(stmt)); getter_AddRefs(updateStmt));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), dl->mGUID); rv = updateStmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), dl->mGUID);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("id"), dl->mID); rv = updateStmt->BindInt64ByName(NS_LITERAL_CSTRING("id"), dl->mID);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->Execute(); rv = updateStmt->Execute();
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
} }
@ -1489,9 +1489,6 @@ nsDownloadManager::GetUserDownloadsDirectory(nsIFile **aResult)
case 0: // Desktop case 0: // Desktop
{ {
nsCOMPtr<nsIFile> downloadDir; nsCOMPtr<nsIFile> downloadDir;
nsCOMPtr<nsIProperties> dirService =
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = dirService->Get(NS_OS_DESKTOP_DIR, rv = dirService->Get(NS_OS_DESKTOP_DIR,
NS_GET_IID(nsIFile), NS_GET_IID(nsIFile),
getter_AddRefs(downloadDir)); getter_AddRefs(downloadDir));