Bug 1370583 - Get URIClassifier service eariler. r=francois

Move the initialization of nsUrlClassifierDBService to prior of calling ShouldEnableTrackingProtection(), so the nsUrlClassifierDBService will be initialized before staring HTTP connection. If not doing so, there is a 3.x% peformance regression on android platforam.
This commit is contained in:
Kershaw Chang 2017-06-19 22:59:00 -04:00
Родитель 08f93f542e
Коммит c402e676f3
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1200,16 +1200,16 @@ nsChannelClassifier::CheckIsTrackerWithLocalTable(nsIURIClassifierCallback* aCal
return NS_ERROR_INVALID_ARG;
}
if (!ShouldEnableTrackingProtection() && !ShouldEnableTrackingAnnotation()) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIURIClassifier> uriClassifier =
do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
return rv;
}
if (!ShouldEnableTrackingProtection() && !ShouldEnableTrackingAnnotation()) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIURI> uri;
rv = mChannel->GetURI(getter_AddRefs(uri));
if (NS_FAILED(rv) || !uri) {