mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout 91eed468cff8 (Bug 726002) due to broken error handling.
This commit is contained in:
parent
3a3201602c
commit
e289e7f45a
@ -174,9 +174,6 @@ nsresult
|
||||
LookupCache::Build(const AddPrefixArray& aAddPrefixes,
|
||||
const AddCompleteArray& aAddCompletes)
|
||||
{
|
||||
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_COMPLETIONS,
|
||||
static_cast<PRUint32>(aAddCompletes.Length()));
|
||||
|
||||
mCompletions.Clear();
|
||||
mCompletions.SetCapacity(aAddCompletes.Length());
|
||||
for (uint32 i = 0; i < aAddCompletes.Length(); i++) {
|
||||
@ -184,13 +181,16 @@ LookupCache::Build(const AddPrefixArray& aAddPrefixes,
|
||||
}
|
||||
mCompletions.Sort();
|
||||
|
||||
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_PREFIXES,
|
||||
static_cast<PRUint32>(aAddPrefixes.Length()));
|
||||
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_COMPLETIONS,
|
||||
static_cast<PRUint32>(mCompletions.Length()));
|
||||
|
||||
nsresult rv = ConstructPrefixSet(aAddPrefixes);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mPrimed = true;
|
||||
|
||||
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_PREFIXES,
|
||||
static_cast<PRUint32>(aAddPrefixes.Length()));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -683,11 +683,8 @@ LookupCache::ConstructPrefixSet(const AddPrefixArray& aAddPrefixes)
|
||||
{
|
||||
Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_PS_CONSTRUCT_TIME> timer;
|
||||
|
||||
FallibleTArray<PRUint32> array;
|
||||
nsresult rv = array.SetCapacity(aAddPrefixes.Length());
|
||||
if (NS_FAILED(rv)) {
|
||||
goto error_bailout;
|
||||
}
|
||||
nsTArray<PRUint32> array;
|
||||
array.SetCapacity(aAddPrefixes.Length());
|
||||
|
||||
for (uint32 i = 0; i < aAddPrefixes.Length(); i++) {
|
||||
array.AppendElement(aAddPrefixes[i].PrefixHash().ToUint32());
|
||||
@ -702,7 +699,7 @@ LookupCache::ConstructPrefixSet(const AddPrefixArray& aAddPrefixes)
|
||||
array.Sort();
|
||||
|
||||
// construct new one, replace old entries
|
||||
rv = mPrefixSet->SetPrefixes(array.Elements(), array.Length());
|
||||
nsresult rv = mPrefixSet->SetPrefixes(array.Elements(), array.Length());
|
||||
if (NS_FAILED(rv)) {
|
||||
goto error_bailout;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user