Backed out changeset 9846de3bd954 (bug 1372405)

This commit is contained in:
Carsten "Tomcat" Book
2017-06-20 08:27:02 +02:00
parent 0640fe35ce
commit bbe9441993
613 changed files with 3568 additions and 6338 deletions

View File

@@ -302,8 +302,7 @@ Classifier::Reset()
return;
}
nsCOMPtr<nsIRunnable> r =
NS_NewRunnableFunction("safebrowsing::Classifier::Reset", resetFunc);
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(resetFunc);
SyncRunnable::DispatchToThread(mUpdateThread, r);
}
@@ -739,30 +738,25 @@ Classifier::AsyncApplyUpdates(nsTArray<TableUpdate*>* aUpdates,
nsCOMPtr<nsIThread> callerThread = NS_GetCurrentThread();
MOZ_ASSERT(callerThread != mUpdateThread);
nsCOMPtr<nsIRunnable> bgRunnable =
NS_NewRunnableFunction("safebrowsing::Classifier::AsyncApplyUpdates", [=] {
MOZ_ASSERT(NS_GetCurrentThread() == mUpdateThread,
"MUST be on update thread");
nsCOMPtr<nsIRunnable> bgRunnable = NS_NewRunnableFunction([=] {
MOZ_ASSERT(NS_GetCurrentThread() == mUpdateThread, "MUST be on update thread");
LOG(("Step 1. ApplyUpdatesBackground on update thread."));
nsCString failedTableName;
nsresult bgRv = ApplyUpdatesBackground(aUpdates, failedTableName);
LOG(("Step 1. ApplyUpdatesBackground on update thread."));
nsCString failedTableName;
nsresult bgRv = ApplyUpdatesBackground(aUpdates, failedTableName);
nsCOMPtr<nsIRunnable> fgRunnable = NS_NewRunnableFunction(
"safebrowsing::Classifier::AsyncApplyUpdates", [=] {
MOZ_ASSERT(NS_GetCurrentThread() == callerThread,
"MUST be on caller thread");
nsCOMPtr<nsIRunnable> fgRunnable = NS_NewRunnableFunction([=] {
MOZ_ASSERT(NS_GetCurrentThread() == callerThread, "MUST be on caller thread");
LOG(("Step 2. ApplyUpdatesForeground on caller thread"));
nsresult rv = ApplyUpdatesForeground(bgRv, failedTableName);
;
LOG(("Step 2. ApplyUpdatesForeground on caller thread"));
nsresult rv = ApplyUpdatesForeground(bgRv, failedTableName);;
LOG(("Step 3. Updates applied! Fire callback."));
LOG(("Step 3. Updates applied! Fire callback."));
aCallback(rv);
});
callerThread->Dispatch(fgRunnable, NS_DISPATCH_NORMAL);
aCallback(rv);
});
callerThread->Dispatch(fgRunnable, NS_DISPATCH_NORMAL);
});
return mUpdateThread->Dispatch(bgRunnable, NS_DISPATCH_NORMAL);
}