Bug 1315386 - Make Safe Browsing code more shutdown-aware. r=francois,gcp.
MozReview-Commit-ID: ATCVfh5YLZl
This commit is contained in:
@@ -336,6 +336,11 @@ Classifier::DeleteTables(nsIFile* aDirectory, const nsTArray<nsCString>& aTables
|
||||
void
|
||||
Classifier::AbortUpdateAndReset(const nsCString& aTable)
|
||||
{
|
||||
// We don't need to reset while shutting down. It will only slow us down.
|
||||
if (nsUrlClassifierDBService::ShutdownHasStarted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(("Abort updating table %s.", aTable.get()));
|
||||
|
||||
// ResetTables will clear both in-memory & on-disk data.
|
||||
@@ -946,6 +951,10 @@ nsresult
|
||||
Classifier::UpdateHashStore(nsTArray<TableUpdate*>* aUpdates,
|
||||
const nsACString& aTable)
|
||||
{
|
||||
if (nsUrlClassifierDBService::ShutdownHasStarted()) {
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
LOG(("Classifier::UpdateHashStore(%s)", PromiseFlatCString(aTable).get()));
|
||||
|
||||
HashStore store(aTable, GetProvider(aTable), mRootStoreDirectory);
|
||||
@@ -1044,6 +1053,9 @@ Classifier::UpdateTableV4(nsTArray<TableUpdate*>* aUpdates,
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread(),
|
||||
"UpdateTableV4 must be called on the classifier worker thread.");
|
||||
if (nsUrlClassifierDBService::ShutdownHasStarted()) {
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
LOG(("Classifier::UpdateTableV4(%s)", PromiseFlatCString(aTable).get()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user