Bug 1323953 - Send 4-byte prefix for both v2/v4 tables. r=francois

MozReview-Commit-ID: 1jlBdSQARNg

--HG--
extra : rebase_source : 94ca2da38a7aeae061a37cb9013b45dfefbcc843
This commit is contained in:
Henry Chang 2017-02-07 10:56:12 +08:00
Родитель c49c5962c5
Коммит a835d0face
1 изменённых файлов: 4 добавлений и 13 удалений

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

@ -996,20 +996,11 @@ nsUrlClassifierLookupCallback::LookupComplete(nsTArray<LookupResult>* results)
mDBService->GetCompleter(result.mTableName,
getter_AddRefs(completer))) {
// TODO: Figure out how long the partial hash should be sent
// for completion. See Bug 1323953.
// Bug 1323953 - Send the first 4 bytes for completion no matter how
// long we matched the prefix.
nsAutoCString partialHash;
if (StringEndsWith(result.mTableName, NS_LITERAL_CSTRING("-proto"))) {
// We send the complete partial hash for v4 at the moment.
partialHash = result.PartialHash();
} else {
// We always send the first 4 bytes of the partial hash for
// non-v4 tables. This matters when we have 32-byte prefix
// in "test-xxx-simple" test data.
partialHash.Assign(reinterpret_cast<char*>(&result.hash.fixedLengthPrefix),
PREFIX_SIZE);
}
partialHash.Assign(reinterpret_cast<char*>(&result.hash.fixedLengthPrefix),
PREFIX_SIZE);
nsresult rv = completer->Complete(partialHash,
gethashUrl,
result.mTableName,