Bug 1394031 - Remove mCryptoHash members of nsUrlClassifierDBServiceWorker and ProtocolParser

The usage of cryptoHash consists of a complete set of Init, Update, and Finish, there's
no reason to keep it around

MozReview-Commit-ID: 7bT9IsWEM5m
This commit is contained in:
Thomas Nguyen
2017-09-05 17:14:54 +08:00
parent ba76467e4d
commit 71a001d62e
12 changed files with 30 additions and 61 deletions

View File

@@ -8,8 +8,6 @@
#include "nsAppDirectoryServiceDefs.h"
#include "nsArrayUtils.h"
#include "nsCRT.h"
#include "nsICryptoHash.h"
#include "nsICryptoHMAC.h"
#include "nsIDirectoryService.h"
#include "nsIKeyModule.h"
#include "nsIObserverService.h"
@@ -467,8 +465,6 @@ nsUrlClassifierDBServiceWorker::BeginStream(const nsACString &table)
return NS_ERROR_OUT_OF_MEMORY;
}
mProtocolParser->Init(mCryptoHash);
if (!table.IsEmpty()) {
mProtocolParser->SetCurrentTable(table);
}
@@ -809,7 +805,6 @@ nsUrlClassifierDBServiceWorker::CloseDb()
mClassifier = nullptr;
}
mCryptoHash = nullptr;
LOG(("urlclassifier db closed\n"));
return NS_OK;
@@ -944,9 +939,6 @@ nsUrlClassifierDBServiceWorker::OpenDb()
}
nsresult rv;
mCryptoHash = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoPtr<Classifier> classifier(new (fallible) Classifier());
if (!classifier) {
return NS_ERROR_OUT_OF_MEMORY;