зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1599379 - Create a DBService instance in GetWorker API when it doesn't exist. r=baku
There are two places using DBService during a page load at startup: 1. nsChannelClassifier::Start, used by Phishing Protection 2. AsyncChannelClassifier::CheckChannel, used by Tracking Protection Tracking protection checks happen before establishing a network connection, so it happens prior to phishing protection checkes. When we load a page at startup, ::CheckChannel API is called, but DBService is not yet created. This patch fixes this issue by creating a DBService instance when ::GetWorker API is called without a DBService instance. Differential Revision: https://phabricator.services.mozilla.com/D55248 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b0a4cb0d30
Коммит
97ee7956bf
|
@ -2402,11 +2402,14 @@ bool nsUrlClassifierDBService::ShutdownHasStarted() {
|
|||
|
||||
// static
|
||||
nsUrlClassifierDBServiceWorker* nsUrlClassifierDBService::GetWorker() {
|
||||
if (!sUrlClassifierDBService) {
|
||||
nsresult rv;
|
||||
RefPtr<nsUrlClassifierDBService> service =
|
||||
nsUrlClassifierDBService::GetInstance(&rv);
|
||||
if (!service) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return sUrlClassifierDBService->mWorker;
|
||||
return service->mWorker;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче