mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 825627, part 1: Make nsUrlClassifierDBService.cpp's "gethashNoise" & "aCount" variables as unsigned, since counts are unsigned by definition. r=gcp
This commit is contained in:
parent
df741f9977
commit
d056e13800
@ -778,7 +778,7 @@ Classifier::GetLookupCache(const nsACString& aTable)
|
|||||||
nsresult
|
nsresult
|
||||||
Classifier::ReadNoiseEntries(const Prefix& aPrefix,
|
Classifier::ReadNoiseEntries(const Prefix& aPrefix,
|
||||||
const nsACString& aTableName,
|
const nsACString& aTableName,
|
||||||
int32_t aCount,
|
uint32_t aCount,
|
||||||
PrefixArray* aNoiseEntries)
|
PrefixArray* aNoiseEntries)
|
||||||
{
|
{
|
||||||
LookupCache *cache = GetLookupCache(aTableName);
|
LookupCache *cache = GetLookupCache(aTableName);
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
nsresult ReadNoiseEntries(const Prefix& aPrefix,
|
nsresult ReadNoiseEntries(const Prefix& aPrefix,
|
||||||
const nsACString& aTableName,
|
const nsACString& aTableName,
|
||||||
int32_t aCount,
|
uint32_t aCount,
|
||||||
PrefixArray* aNoiseEntries);
|
PrefixArray* aNoiseEntries);
|
||||||
private:
|
private:
|
||||||
void DropStores();
|
void DropStores();
|
||||||
|
@ -116,7 +116,7 @@ public:
|
|||||||
NS_DECL_NSIURLCLASSIFIERDBSERVICE
|
NS_DECL_NSIURLCLASSIFIERDBSERVICE
|
||||||
NS_DECL_NSIURLCLASSIFIERDBSERVICEWORKER
|
NS_DECL_NSIURLCLASSIFIERDBSERVICEWORKER
|
||||||
|
|
||||||
nsresult Init(int32_t gethashNoise, nsCOMPtr<nsIFile> aCacheDir,
|
nsresult Init(uint32_t aGethashNoise, nsCOMPtr<nsIFile> aCacheDir,
|
||||||
bool aPerClientRandomize);
|
bool aPerClientRandomize);
|
||||||
|
|
||||||
// Queue a lookup for the worker to perform, called in the main thread.
|
// Queue a lookup for the worker to perform, called in the main thread.
|
||||||
@ -150,7 +150,7 @@ private:
|
|||||||
|
|
||||||
nsresult AddNoise(const Prefix aPrefix,
|
nsresult AddNoise(const Prefix aPrefix,
|
||||||
const nsCString tableName,
|
const nsCString tableName,
|
||||||
int32_t aCount,
|
uint32_t aCount,
|
||||||
LookupResultArray& results);
|
LookupResultArray& results);
|
||||||
|
|
||||||
nsCOMPtr<nsICryptoHash> mCryptoHash;
|
nsCOMPtr<nsICryptoHash> mCryptoHash;
|
||||||
@ -184,7 +184,7 @@ private:
|
|||||||
uint32_t mHashKey;
|
uint32_t mHashKey;
|
||||||
|
|
||||||
// The number of noise entries to add to the set of lookup results.
|
// The number of noise entries to add to the set of lookup results.
|
||||||
int32_t mGethashNoise;
|
uint32_t mGethashNoise;
|
||||||
|
|
||||||
// Randomize clients with a key or not.
|
// Randomize clients with a key or not.
|
||||||
bool mPerClientRandomize;
|
bool mPerClientRandomize;
|
||||||
@ -224,11 +224,11 @@ nsUrlClassifierDBServiceWorker::~nsUrlClassifierDBServiceWorker()
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsUrlClassifierDBServiceWorker::Init(int32_t gethashNoise,
|
nsUrlClassifierDBServiceWorker::Init(uint32_t aGethashNoise,
|
||||||
nsCOMPtr<nsIFile> aCacheDir,
|
nsCOMPtr<nsIFile> aCacheDir,
|
||||||
bool aPerClientRandomize)
|
bool aPerClientRandomize)
|
||||||
{
|
{
|
||||||
mGethashNoise = gethashNoise;
|
mGethashNoise = aGethashNoise;
|
||||||
mCacheDir = aCacheDir;
|
mCacheDir = aCacheDir;
|
||||||
mPerClientRandomize = aPerClientRandomize;
|
mPerClientRandomize = aPerClientRandomize;
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ nsUrlClassifierDBServiceWorker::HandlePendingLookups()
|
|||||||
nsresult
|
nsresult
|
||||||
nsUrlClassifierDBServiceWorker::AddNoise(const Prefix aPrefix,
|
nsUrlClassifierDBServiceWorker::AddNoise(const Prefix aPrefix,
|
||||||
const nsCString tableName,
|
const nsCString tableName,
|
||||||
int32_t aCount,
|
uint32_t aCount,
|
||||||
LookupResultArray& results)
|
LookupResultArray& results)
|
||||||
{
|
{
|
||||||
if (aCount < 1) {
|
if (aCount < 1) {
|
||||||
@ -1129,7 +1129,7 @@ nsUrlClassifierDBService::Init()
|
|||||||
// Should we check document loads for malware URIs?
|
// Should we check document loads for malware URIs?
|
||||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||||
|
|
||||||
int32_t gethashNoise = 0;
|
uint32_t gethashNoise = 0;
|
||||||
if (prefs) {
|
if (prefs) {
|
||||||
bool tmpbool;
|
bool tmpbool;
|
||||||
rv = prefs->GetBoolPref(CHECK_MALWARE_PREF, &tmpbool);
|
rv = prefs->GetBoolPref(CHECK_MALWARE_PREF, &tmpbool);
|
||||||
@ -1142,9 +1142,10 @@ nsUrlClassifierDBService::Init()
|
|||||||
|
|
||||||
prefs->AddObserver(CHECK_PHISHING_PREF, this, false);
|
prefs->AddObserver(CHECK_PHISHING_PREF, this, false);
|
||||||
|
|
||||||
if (NS_FAILED(prefs->GetIntPref(GETHASH_NOISE_PREF, &gethashNoise))) {
|
int32_t tmpint;
|
||||||
gethashNoise = GETHASH_NOISE_DEFAULT;
|
rv = prefs->GetIntPref(GETHASH_NOISE_PREF, &tmpint);
|
||||||
}
|
gethashNoise = (NS_SUCCEEDED(rv) && tmpint >= 0) ?
|
||||||
|
static_cast<uint32_t>(tmpint) : GETHASH_NOISE_DEFAULT;
|
||||||
|
|
||||||
nsXPIDLCString tmpstr;
|
nsXPIDLCString tmpstr;
|
||||||
if (NS_SUCCEEDED(prefs->GetCharPref(GETHASH_TABLES_PREF, getter_Copies(tmpstr)))) {
|
if (NS_SUCCEEDED(prefs->GetCharPref(GETHASH_TABLES_PREF, getter_Copies(tmpstr)))) {
|
||||||
@ -1153,7 +1154,6 @@ nsUrlClassifierDBService::Init()
|
|||||||
|
|
||||||
prefs->AddObserver(GETHASH_TABLES_PREF, this, false);
|
prefs->AddObserver(GETHASH_TABLES_PREF, this, false);
|
||||||
|
|
||||||
int32_t tmpint;
|
|
||||||
rv = prefs->GetIntPref(CONFIRM_AGE_PREF, &tmpint);
|
rv = prefs->GetIntPref(CONFIRM_AGE_PREF, &tmpint);
|
||||||
PR_ATOMIC_SET(&gFreshnessGuarantee, NS_SUCCEEDED(rv) ? tmpint : CONFIRM_AGE_DEFAULT_SEC);
|
PR_ATOMIC_SET(&gFreshnessGuarantee, NS_SUCCEEDED(rv) ? tmpint : CONFIRM_AGE_DEFAULT_SEC);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user