mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1041855: Skip gethash completions on startup for hits in existing tables that haven't been registered yet (r=gcp)
This commit is contained in:
parent
88c58d592b
commit
eac23f060e
@ -837,14 +837,14 @@ nsUrlClassifierLookupCallback::LookupComplete(nsTArray<LookupResult>* results)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = listManager->GetGethashUrl(result.mTableName, gethashUrl);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (mDBService->GetCompleter(result.mTableName,
|
||||
// gethashUrls may be empty in 2 cases: test tables, and on startup where
|
||||
// we may have found a prefix in an existing table before the listmanager
|
||||
// has registered the table. In the second case we should not call
|
||||
// complete.
|
||||
if ((!gethashUrl.IsEmpty() ||
|
||||
StringBeginsWith(result.mTableName, NS_LITERAL_CSTRING("test-"))) &&
|
||||
mDBService->GetCompleter(result.mTableName,
|
||||
getter_AddRefs(completer))) {
|
||||
// Only allow empty gethashUrls for test tables if a completer exists.
|
||||
if (gethashUrl.IsEmpty()) {
|
||||
MOZ_ASSERT(
|
||||
StringBeginsWith(result.mTableName, NS_LITERAL_CSTRING("test-")),
|
||||
"Only test tables may have empty gethash urls");
|
||||
}
|
||||
nsAutoCString partialHash;
|
||||
partialHash.Assign(reinterpret_cast<char*>(&result.hash.prefix),
|
||||
PREFIX_SIZE);
|
||||
|
Loading…
Reference in New Issue
Block a user