mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 09:18:42 +09:00
Make safebrowsing optional at build time - Part 3: toolkit/
This commit is contained in:
parent
62afe1838f
commit
5c16f3d5ba
5 changed files with 33 additions and 3 deletions
|
|
@ -26,11 +26,13 @@
|
|||
|
||||
#include "nsTypeAheadFind.h"
|
||||
|
||||
#ifdef MOZ_URL_CLASSIFIER
|
||||
#include "ApplicationReputation.h"
|
||||
#include "nsUrlClassifierDBService.h"
|
||||
#include "nsUrlClassifierStreamUpdater.h"
|
||||
#include "nsUrlClassifierUtils.h"
|
||||
#include "nsUrlClassifierPrefixSet.h"
|
||||
#endif
|
||||
|
||||
#include "nsBrowserStatusFilter.h"
|
||||
#include "mozilla/FinalizationWitnessService.h"
|
||||
|
|
@ -91,6 +93,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
|
|||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
|
||||
|
||||
#ifdef MOZ_URL_CLASSIFIER
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ApplicationReputationService,
|
||||
ApplicationReputationService::GetSingleton)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierPrefixSet)
|
||||
|
|
@ -115,6 +118,7 @@ nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, REFNSIID aIID,
|
|||
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
|
||||
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
|
||||
|
|
@ -148,11 +152,13 @@ NS_DEFINE_NAMED_CID(NS_DOWNLOADPLATFORM_CID);
|
|||
NS_DEFINE_NAMED_CID(NS_DOWNLOAD_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_FIND_SERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_TYPEAHEADFIND_CID);
|
||||
#ifdef MOZ_URL_CLASSIFIER
|
||||
NS_DEFINE_NAMED_CID(NS_APPLICATION_REPUTATION_SERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERPREFIXSET_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERDBSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERSTREAMUPDATER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTILS_CID);
|
||||
#endif
|
||||
NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID);
|
||||
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
|
||||
NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
|
||||
|
|
@ -184,11 +190,13 @@ static const Module::CIDEntry kToolkitCIDs[] = {
|
|||
{ &kNS_DOWNLOAD_CID, false, nullptr, nsDownloadProxyConstructor },
|
||||
{ &kNS_FIND_SERVICE_CID, false, nullptr, nsFindServiceConstructor },
|
||||
{ &kNS_TYPEAHEADFIND_CID, false, nullptr, nsTypeAheadFindConstructor },
|
||||
#ifdef MOZ_URL_CLASSIFIER
|
||||
{ &kNS_APPLICATION_REPUTATION_SERVICE_CID, false, nullptr, ApplicationReputationServiceConstructor },
|
||||
{ &kNS_URLCLASSIFIERPREFIXSET_CID, false, nullptr, nsUrlClassifierPrefixSetConstructor },
|
||||
{ &kNS_URLCLASSIFIERDBSERVICE_CID, false, nullptr, nsUrlClassifierDBServiceConstructor },
|
||||
{ &kNS_URLCLASSIFIERSTREAMUPDATER_CID, false, nullptr, nsUrlClassifierStreamUpdaterConstructor },
|
||||
{ &kNS_URLCLASSIFIERUTILS_CID, false, nullptr, nsUrlClassifierUtilsConstructor },
|
||||
#endif
|
||||
{ &kNS_BROWSERSTATUSFILTER_CID, false, nullptr, nsBrowserStatusFilterConstructor },
|
||||
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
|
||||
{ &kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor },
|
||||
|
|
@ -221,12 +229,14 @@ static const Module::ContractIDEntry kToolkitContracts[] = {
|
|||
{ NS_DOWNLOADPLATFORM_CONTRACTID, &kNS_DOWNLOADPLATFORM_CID },
|
||||
{ NS_FIND_SERVICE_CONTRACTID, &kNS_FIND_SERVICE_CID },
|
||||
{ NS_TYPEAHEADFIND_CONTRACTID, &kNS_TYPEAHEADFIND_CID },
|
||||
#ifdef MOZ_URL_CLASSIFIER
|
||||
{ NS_APPLICATION_REPUTATION_SERVICE_CONTRACTID, &kNS_APPLICATION_REPUTATION_SERVICE_CID },
|
||||
{ NS_URLCLASSIFIERPREFIXSET_CONTRACTID, &kNS_URLCLASSIFIERPREFIXSET_CID },
|
||||
{ NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID },
|
||||
{ NS_URICLASSIFIERSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID },
|
||||
{ NS_URLCLASSIFIERSTREAMUPDATER_CONTRACTID, &kNS_URLCLASSIFIERSTREAMUPDATER_CID },
|
||||
{ NS_URLCLASSIFIERUTILS_CONTRACTID, &kNS_URLCLASSIFIERUTILS_CID },
|
||||
#endif
|
||||
{ NS_BROWSERSTATUSFILTER_CONTRACTID, &kNS_BROWSERSTATUSFILTER_CID },
|
||||
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
|
||||
{ NS_UPDATEPROCESSOR_CONTRACTID, &kNS_UPDATEPROCESSOR_CID },
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ XPIDL_SOURCES += [
|
|||
XPIDL_MODULE = 'downloads'
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'ApplicationReputation.cpp',
|
||||
'chromium/chrome/common/safe_browsing/csd.pb.cc',
|
||||
'nsDownloadManager.cpp'
|
||||
]
|
||||
|
||||
|
|
@ -42,6 +40,12 @@ SOURCES += [
|
|||
'SQLFunctions.cpp',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_URL_CLASSIFIER']:
|
||||
UNIFIED_SOURCES += [
|
||||
'ApplicationReputation.cpp',
|
||||
'chromium/chrome/common/safe_browsing/csd.pb.cc'
|
||||
]
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
# Can't build unified because we need CreateEvent which some IPC code
|
||||
# included in LoadContext ends up undefining.
|
||||
|
|
|
|||
|
|
@ -473,6 +473,12 @@ this.DownloadIntegration = {
|
|||
* }
|
||||
*/
|
||||
shouldBlockForReputationCheck(aDownload) {
|
||||
#ifndef MOZ_URL_CLASSIFIER
|
||||
return Promise.resolve({
|
||||
shouldBlock: false,
|
||||
verdict: "",
|
||||
});
|
||||
#else
|
||||
let hash;
|
||||
let sigInfo;
|
||||
let channelRedirects;
|
||||
|
|
@ -513,6 +519,7 @@ this.DownloadIntegration = {
|
|||
});
|
||||
});
|
||||
return deferred.promise;
|
||||
#endif
|
||||
},
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ DIRS += [
|
|||
'tooltiptext',
|
||||
'typeaheadfind',
|
||||
'utils',
|
||||
'url-classifier',
|
||||
'urlformatter',
|
||||
'viewconfig',
|
||||
'workerloader',
|
||||
|
|
@ -94,6 +93,9 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
|||
if CONFIG['MOZ_TOOLKIT_SEARCH']:
|
||||
DIRS += ['search']
|
||||
|
||||
if CONFIG['MOZ_URL_CLASSIFIER']:
|
||||
DIRS += ['url-classifier']
|
||||
|
||||
DIRS += ['captivedetect']
|
||||
|
||||
if CONFIG['OS_TARGET'] != 'Android':
|
||||
|
|
|
|||
|
|
@ -81,6 +81,13 @@ this.AppConstants = Object.freeze({
|
|||
false,
|
||||
#endif
|
||||
|
||||
MOZ_SAFE_BROWSING:
|
||||
#ifdef MOZ_SAFE_BROWSING
|
||||
true,
|
||||
#else
|
||||
false,
|
||||
#endif
|
||||
|
||||
MOZ_TELEMETRY_REPORTING:
|
||||
#ifdef MOZ_TELEMETRY_REPORTING
|
||||
true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue