Commit d0788ba8 authored by Bettina's avatar Bettina Committed by Commit Bot

Don't compile DownloadService in Android.

Bug: 996380
Change-Id: I57e49cad315fb038ef4b9dfb71293f49f64c749f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769728
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690903}
parent 0d03987a
......@@ -99,12 +99,6 @@ jumbo_static_library("safe_browsing") {
"//chrome/common/safe_browsing:proto",
"//components/safe_browsing:csd_proto",
"//components/safe_browsing:safe_browsing",
# TODO(crbug/996380): This is needed because the DownloadProtectionService
# is being built on Android. Since we don't actually use any
# DownloadProtectionService features on Android, we should fix that
# dependency and move this to the 'safe_browsing_mode == 1' section.
"//components/safe_browsing:webprotect_proto",
"//components/safe_browsing/browser",
"//components/safe_browsing/common",
"//components/safe_browsing/common:safe_browsing_prefs",
......@@ -226,6 +220,7 @@ jumbo_static_library("safe_browsing") {
"//components/content_settings/core/browser",
"//components/language/core/common",
"//components/prefs",
"//components/safe_browsing:webprotect_proto",
"//components/safe_browsing/db",
"//components/security_interstitials/content:security_interstitial_page",
"//content/public/browser",
......
......@@ -101,10 +101,6 @@ ClientSideDetectionService* ServicesDelegateAndroid::GetCsdService() {
return nullptr;
}
DownloadProtectionService* ServicesDelegateAndroid::GetDownloadService() {
return nullptr;
}
void ServicesDelegateAndroid::StartOnIOThread(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const V4ProtocolConfig& v4_config) {
......
......@@ -39,7 +39,6 @@ class ServicesDelegateAndroid : public ServicesDelegate {
const DelayedAnalysisCallback& callback) override;
void AddDownloadManager(content::DownloadManager* download_manager) override;
ClientSideDetectionService* GetCsdService() override;
DownloadProtectionService* GetDownloadService() override;
void StartOnIOThread(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
......
......@@ -19,6 +19,7 @@
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
#include "base/sequenced_task_runner_helpers.h"
#include "build/build_config.h"
#include "chrome/browser/net/proxy_config_monitor.h"
#include "chrome/browser/safe_browsing/services_delegate.h"
#include "components/safe_browsing/buildflags.h"
......@@ -64,7 +65,9 @@ namespace safe_browsing {
class PingManager;
class VerdictCacheManager;
class ClientSideDetectionService;
#if !defined(OS_ANDROID)
class DownloadProtectionService;
#endif
class PasswordProtectionService;
class SafeBrowsingDatabaseManager;
class SafeBrowsingNavigationObserverManager;
......@@ -118,10 +121,11 @@ class SafeBrowsingService : public SafeBrowsingServiceInterface,
// The DownloadProtectionService is not valid after the SafeBrowsingService
// is destroyed.
#if !defined(OS_ANDROID)
DownloadProtectionService* download_protection_service() const {
return services_delegate_->GetDownloadService();
}
#endif
// NetworkContext and URLLoaderFactory used for safe browsing requests.
// Called on UI thread.
network::mojom::NetworkContext* GetNetworkContext();
......
......@@ -9,6 +9,7 @@
#include <string>
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "chrome/browser/safe_browsing/incident_reporting/delayed_analysis_callback.h"
class Profile;
......@@ -31,7 +32,9 @@ namespace safe_browsing {
class BinaryUploadService;
class ClientSideDetectionService;
#if !defined(OS_ANDROID)
class DownloadProtectionService;
#endif
class IncidentReportingService;
class PasswordProtectionService;
class ResourceRequestDetector;
......@@ -56,14 +59,18 @@ class ServicesDelegate {
class ServicesCreator {
public:
virtual bool CanCreateDatabaseManager() = 0;
#if !defined(OS_ANDROID)
virtual bool CanCreateDownloadProtectionService() = 0;
#endif
virtual bool CanCreateIncidentReportingService() = 0;
virtual bool CanCreateResourceRequestDetector() = 0;
// Caller takes ownership of the returned object. Cannot use std::unique_ptr
// because services may not be implemented for some build configs.
virtual SafeBrowsingDatabaseManager* CreateDatabaseManager() = 0;
#if !defined(OS_ANDROID)
virtual DownloadProtectionService* CreateDownloadProtectionService() = 0;
#endif
virtual IncidentReportingService* CreateIncidentReportingService() = 0;
virtual ResourceRequestDetector* CreateResourceRequestDetector() = 0;
};
......@@ -110,8 +117,9 @@ class ServicesDelegate {
// Returns nullptr for any service that is not available.
virtual ClientSideDetectionService* GetCsdService() = 0;
#if !defined(OS_ANDROID)
virtual DownloadProtectionService* GetDownloadService() = 0;
#endif
virtual void StartOnIOThread(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const V4ProtocolConfig& v4_config) = 0;
......
......@@ -87,9 +87,11 @@ void TestSafeBrowsingService::SetV4ProtocolConfig(
bool TestSafeBrowsingService::CanCreateDatabaseManager() {
return !use_v4_local_db_manager_;
}
#if !defined(OS_ANDROID)
bool TestSafeBrowsingService::CanCreateDownloadProtectionService() {
return false;
}
#endif
bool TestSafeBrowsingService::CanCreateIncidentReportingService() {
return true;
}
......@@ -107,11 +109,13 @@ SafeBrowsingDatabaseManager* TestSafeBrowsingService::CreateDatabaseManager() {
#endif // BUILDFLAG(FULL_SAFE_BROWSING)
}
#if !defined(OS_ANDROID)
DownloadProtectionService*
TestSafeBrowsingService::CreateDownloadProtectionService() {
NOTIMPLEMENTED();
return nullptr;
}
#endif
IncidentReportingService*
TestSafeBrowsingService::CreateIncidentReportingService() {
#if BUILDFLAG(FULL_SAFE_BROWSING)
......
......@@ -7,6 +7,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "build/build_config.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "components/safe_browsing/db/v4_protocol_manager_util.h"
......@@ -70,11 +71,15 @@ class TestSafeBrowsingService : public SafeBrowsingService,
// ServicesDelegate::ServicesCreator:
bool CanCreateDatabaseManager() override;
#if !defined(OS_ANDROID)
bool CanCreateDownloadProtectionService() override;
#endif
bool CanCreateIncidentReportingService() override;
bool CanCreateResourceRequestDetector() override;
SafeBrowsingDatabaseManager* CreateDatabaseManager() override;
#if !defined(OS_ANDROID)
DownloadProtectionService* CreateDownloadProtectionService() override;
#endif
IncidentReportingService* CreateIncidentReportingService() override;
ResourceRequestDetector* CreateResourceRequestDetector() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment