Bug 1311933 - P1. Use integer as the key of safebrowsing cache. r=francois

In Bug 1323953, we always send 4-bytes prefix for completion and the prefix is also
used as the key to store cache result from gethash request.
Since it is always 4-bytes, we could convert it to integer for simplicity.

MozReview-Commit-ID: Lkvrg0wvX5Z
This commit is contained in:
dimi
2017-04-11 16:07:26 +08:00
parent b886f0308a
commit b19db734bc
7 changed files with 24 additions and 38 deletions

View File

@@ -194,11 +194,11 @@ TableUpdateV4::NewChecksum(const std::string& aChecksum)
}
nsresult
TableUpdateV4::NewFullHashResponse(const nsACString& aPrefix,
TableUpdateV4::NewFullHashResponse(const Prefix& aPrefix,
CachedFullHashResponse& aResponse)
{
CachedFullHashResponse* response =
mFullHashResponseMap.LookupOrAdd(aPrefix);
mFullHashResponseMap.LookupOrAdd(aPrefix.ToUint32());
if (!response) {
return NS_ERROR_OUT_OF_MEMORY;
}