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:
@@ -1196,6 +1196,7 @@ nsUrlClassifierLookupCallback::CompletionV2(const nsACString& aCompleteHash,
|
||||
auto result = new CacheResultV2;
|
||||
|
||||
result->table = aTableName;
|
||||
result->prefix.Assign(aCompleteHash);
|
||||
result->completion.Assign(aCompleteHash);
|
||||
result->addChunk = aChunkId;
|
||||
|
||||
@@ -1228,7 +1229,7 @@ nsUrlClassifierLookupCallback::CompletionV4(const nsACString& aPartialHash,
|
||||
int64_t nowSec = PR_Now() / PR_USEC_PER_SEC;
|
||||
|
||||
result->table = aTableName;
|
||||
result->prefix = aPartialHash;
|
||||
result->prefix.Assign(aPartialHash);
|
||||
result->response.negativeCacheExpirySec = nowSec + aNegativeCacheDuration;
|
||||
|
||||
// Fill in positive cache entries.
|
||||
|
||||
Reference in New Issue
Block a user