Backed out changeset 4f6302a98ae4 (bug 1372405)

This commit is contained in:
Carsten "Tomcat" Book
2017-06-21 13:59:26 +02:00
parent 69d99ffd13
commit 238bf154d5
617 changed files with 3563 additions and 6334 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);
}