зеркало из https://github.com/mozilla/pjs.git
Backout e0e2cc5570ac (Bug 726002) due to broken error handling.
This commit is contained in:
Родитель
ecdaa304f3
Коммит
9af4659f63
|
@ -531,7 +531,6 @@ Classifier::ApplyTableUpdates(nsTArray<TableUpdate*>* aUpdates,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = store->AugmentAdds(AddPrefixHashes);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
AddPrefixHashes.Clear();
|
||||
|
||||
uint32 applied = 0;
|
||||
bool updateFreshness = false;
|
||||
|
|
|
@ -120,10 +120,10 @@ public:
|
|||
|
||||
ChunkSet& AddChunks() { return mAddChunks; }
|
||||
ChunkSet& SubChunks() { return mSubChunks; }
|
||||
AddPrefixArray& AddPrefixes() { return mAddPrefixes; }
|
||||
AddCompleteArray& AddCompletes() { return mAddCompletes; }
|
||||
SubPrefixArray& SubPrefixes() { return mSubPrefixes; }
|
||||
SubCompleteArray& SubCompletes() { return mSubCompletes; }
|
||||
const AddPrefixArray& AddPrefixes() const { return mAddPrefixes; }
|
||||
const AddCompleteArray& AddCompletes() const { return mAddCompletes; }
|
||||
const SubPrefixArray& SubPrefixes() const { return mSubPrefixes; }
|
||||
const SubCompleteArray& SubCompletes() const { return mSubCompletes; }
|
||||
|
||||
// =======
|
||||
// Updates
|
||||
|
|
|
@ -171,8 +171,8 @@ LookupCache::Reset()
|
|||
|
||||
|
||||
nsresult
|
||||
LookupCache::Build(AddPrefixArray& aAddPrefixes,
|
||||
AddCompleteArray& aAddCompletes)
|
||||
LookupCache::Build(const AddPrefixArray& aAddPrefixes,
|
||||
const AddCompleteArray& aAddCompletes)
|
||||
{
|
||||
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_COMPLETIONS,
|
||||
static_cast<PRUint32>(aAddCompletes.Length()));
|
||||
|
@ -182,7 +182,6 @@ LookupCache::Build(AddPrefixArray& aAddPrefixes,
|
|||
for (uint32 i = 0; i < aAddCompletes.Length(); i++) {
|
||||
mCompletions.AppendElement(aAddCompletes[i].CompleteHash());
|
||||
}
|
||||
aAddCompletes.Clear();
|
||||
mCompletions.Sort();
|
||||
|
||||
Telemetry::Accumulate(Telemetry::URLCLASSIFIER_LC_PREFIXES,
|
||||
|
@ -680,7 +679,7 @@ bool LookupCache::IsPrimed()
|
|||
}
|
||||
|
||||
nsresult
|
||||
LookupCache::ConstructPrefixSet(AddPrefixArray& aAddPrefixes)
|
||||
LookupCache::ConstructPrefixSet(const AddPrefixArray& aAddPrefixes)
|
||||
{
|
||||
Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_PS_CONSTRUCT_TIME> timer;
|
||||
|
||||
|
@ -693,8 +692,8 @@ LookupCache::ConstructPrefixSet(AddPrefixArray& aAddPrefixes)
|
|||
for (uint32 i = 0; i < aAddPrefixes.Length(); i++) {
|
||||
array.AppendElement(aAddPrefixes[i].PrefixHash().ToUint32());
|
||||
}
|
||||
aAddPrefixes.Clear();
|
||||
|
||||
// clear old tree
|
||||
if (array.IsEmpty()) {
|
||||
// DB is empty, but put a sentinel to show that we looked
|
||||
array.AppendElement(0);
|
||||
|
|
|
@ -137,9 +137,8 @@ public:
|
|||
|
||||
nsresult Init();
|
||||
nsresult Open();
|
||||
// This will Clear() the passed arrays when done.
|
||||
nsresult Build(AddPrefixArray& aAddPrefixes,
|
||||
AddCompleteArray& aAddCompletes);
|
||||
nsresult Build(const AddPrefixArray& aAddPrefixes,
|
||||
const AddCompleteArray& aAddCompletes);
|
||||
nsresult GetPrefixes(nsTArray<PRUint32>* aAddPrefixes);
|
||||
|
||||
#if DEBUG && defined(PR_LOGGING)
|
||||
|
@ -161,10 +160,9 @@ private:
|
|||
nsresult ReadHeader();
|
||||
nsresult EnsureSizeConsistent();
|
||||
nsresult ReadCompletions();
|
||||
// Construct a Prefix Set with known prefixes
|
||||
nsresult LoadPrefixSet();
|
||||
// Construct a Prefix Set with known prefixes.
|
||||
// This will Clear() aAddPrefixes when done.
|
||||
nsresult ConstructPrefixSet(AddPrefixArray& aAddPrefixes);
|
||||
nsresult ConstructPrefixSet(const AddPrefixArray& aAddPrefixes);
|
||||
|
||||
struct Header {
|
||||
uint32 magic;
|
||||
|
|
Загрузка…
Ссылка в новой задаче