зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1522265 - Moving malware, phishing and blocked URIs to features - part 2 - factory updated, r=dimi
This commit is contained in:
Родитель
f43141ec0a
Коммит
19c65633d3
|
@ -79,6 +79,11 @@ namespace net {
|
|||
aFeatures.AppendElements(flashFeatures);
|
||||
}
|
||||
|
||||
/* static */ void UrlClassifierFeatureFactory::GetFeaturesNoChannel(
|
||||
nsTArray<RefPtr<nsIUrlClassifierFeature>>& aFeatures) {
|
||||
UrlClassifierFeatureNoChannel::MaybeCreate(aFeatures);
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsIUrlClassifierFeature*
|
||||
UrlClassifierFeatureFactory::GetFeatureLoginReputation() {
|
||||
|
|
|
@ -24,6 +24,9 @@ class UrlClassifierFeatureFactory final {
|
|||
nsIChannel* aChannel,
|
||||
nsTArray<nsCOMPtr<nsIUrlClassifierFeature>>& aFeatures);
|
||||
|
||||
static void GetFeaturesNoChannel(
|
||||
nsTArray<RefPtr<nsIUrlClassifierFeature>>& aFeatures);
|
||||
|
||||
static nsIUrlClassifierFeature* GetFeatureLoginReputation();
|
||||
|
||||
static already_AddRefed<nsIUrlClassifierFeature> GetFeatureByName(
|
||||
|
|
|
@ -71,6 +71,18 @@ UrlClassifierFeatureNoChannel::UrlClassifierFeatureNoChannel(
|
|||
}
|
||||
}
|
||||
|
||||
/* static */ void UrlClassifierFeatureNoChannel::MaybeCreate(
|
||||
nsTArray<RefPtr<nsIUrlClassifierFeature>>& aFeatures) {
|
||||
MaybeInitialize();
|
||||
|
||||
for (const NoChannelFeature& feature : sNoChannelFeaturesMap) {
|
||||
if (feature.mPref()) {
|
||||
MOZ_ASSERT(feature.mFeature);
|
||||
aFeatures.AppendElement(feature.mFeature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<nsIUrlClassifierFeature>
|
||||
UrlClassifierFeatureNoChannel::GetIfNameMatches(const nsACString& aName) {
|
||||
MaybeInitialize();
|
||||
|
|
|
@ -20,6 +20,9 @@ class UrlClassifierFeatureNoChannel final : public UrlClassifierFeatureBase {
|
|||
|
||||
static void MaybeShutdown();
|
||||
|
||||
static void MaybeCreate(
|
||||
nsTArray<RefPtr<nsIUrlClassifierFeature>>& aFeatures);
|
||||
|
||||
static already_AddRefed<nsIUrlClassifierFeature> GetIfNameMatches(
|
||||
const nsACString& aName);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче