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") { ...@@ -99,12 +99,6 @@ jumbo_static_library("safe_browsing") {
"//chrome/common/safe_browsing:proto", "//chrome/common/safe_browsing:proto",
"//components/safe_browsing:csd_proto", "//components/safe_browsing:csd_proto",
"//components/safe_browsing:safe_browsing", "//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/browser",
"//components/safe_browsing/common", "//components/safe_browsing/common",
"//components/safe_browsing/common:safe_browsing_prefs", "//components/safe_browsing/common:safe_browsing_prefs",
...@@ -226,6 +220,7 @@ jumbo_static_library("safe_browsing") { ...@@ -226,6 +220,7 @@ jumbo_static_library("safe_browsing") {
"//components/content_settings/core/browser", "//components/content_settings/core/browser",
"//components/language/core/common", "//components/language/core/common",
"//components/prefs", "//components/prefs",
"//components/safe_browsing:webprotect_proto",
"//components/safe_browsing/db", "//components/safe_browsing/db",
"//components/security_interstitials/content:security_interstitial_page", "//components/security_interstitials/content:security_interstitial_page",
"//content/public/browser", "//content/public/browser",
......
...@@ -101,10 +101,6 @@ ClientSideDetectionService* ServicesDelegateAndroid::GetCsdService() { ...@@ -101,10 +101,6 @@ ClientSideDetectionService* ServicesDelegateAndroid::GetCsdService() {
return nullptr; return nullptr;
} }
DownloadProtectionService* ServicesDelegateAndroid::GetDownloadService() {
return nullptr;
}
void ServicesDelegateAndroid::StartOnIOThread( void ServicesDelegateAndroid::StartOnIOThread(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const V4ProtocolConfig& v4_config) { const V4ProtocolConfig& v4_config) {
......
...@@ -39,7 +39,6 @@ class ServicesDelegateAndroid : public ServicesDelegate { ...@@ -39,7 +39,6 @@ class ServicesDelegateAndroid : public ServicesDelegate {
const DelayedAnalysisCallback& callback) override; const DelayedAnalysisCallback& callback) override;
void AddDownloadManager(content::DownloadManager* download_manager) override; void AddDownloadManager(content::DownloadManager* download_manager) override;
ClientSideDetectionService* GetCsdService() override; ClientSideDetectionService* GetCsdService() override;
DownloadProtectionService* GetDownloadService() override;
void StartOnIOThread( void StartOnIOThread(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/sequenced_task_runner_helpers.h" #include "base/sequenced_task_runner_helpers.h"
#include "build/build_config.h"
#include "chrome/browser/net/proxy_config_monitor.h" #include "chrome/browser/net/proxy_config_monitor.h"
#include "chrome/browser/safe_browsing/services_delegate.h" #include "chrome/browser/safe_browsing/services_delegate.h"
#include "components/safe_browsing/buildflags.h" #include "components/safe_browsing/buildflags.h"
...@@ -64,7 +65,9 @@ namespace safe_browsing { ...@@ -64,7 +65,9 @@ namespace safe_browsing {
class PingManager; class PingManager;
class VerdictCacheManager; class VerdictCacheManager;
class ClientSideDetectionService; class ClientSideDetectionService;
#if !defined(OS_ANDROID)
class DownloadProtectionService; class DownloadProtectionService;
#endif
class PasswordProtectionService; class PasswordProtectionService;
class SafeBrowsingDatabaseManager; class SafeBrowsingDatabaseManager;
class SafeBrowsingNavigationObserverManager; class SafeBrowsingNavigationObserverManager;
...@@ -118,10 +121,11 @@ class SafeBrowsingService : public SafeBrowsingServiceInterface, ...@@ -118,10 +121,11 @@ class SafeBrowsingService : public SafeBrowsingServiceInterface,
// The DownloadProtectionService is not valid after the SafeBrowsingService // The DownloadProtectionService is not valid after the SafeBrowsingService
// is destroyed. // is destroyed.
#if !defined(OS_ANDROID)
DownloadProtectionService* download_protection_service() const { DownloadProtectionService* download_protection_service() const {
return services_delegate_->GetDownloadService(); return services_delegate_->GetDownloadService();
} }
#endif
// NetworkContext and URLLoaderFactory used for safe browsing requests. // NetworkContext and URLLoaderFactory used for safe browsing requests.
// Called on UI thread. // Called on UI thread.
network::mojom::NetworkContext* GetNetworkContext(); network::mojom::NetworkContext* GetNetworkContext();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <string> #include <string>
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "chrome/browser/safe_browsing/incident_reporting/delayed_analysis_callback.h" #include "chrome/browser/safe_browsing/incident_reporting/delayed_analysis_callback.h"
class Profile; class Profile;
...@@ -31,7 +32,9 @@ namespace safe_browsing { ...@@ -31,7 +32,9 @@ namespace safe_browsing {
class BinaryUploadService; class BinaryUploadService;
class ClientSideDetectionService; class ClientSideDetectionService;
#if !defined(OS_ANDROID)
class DownloadProtectionService; class DownloadProtectionService;
#endif
class IncidentReportingService; class IncidentReportingService;
class PasswordProtectionService; class PasswordProtectionService;
class ResourceRequestDetector; class ResourceRequestDetector;
...@@ -56,14 +59,18 @@ class ServicesDelegate { ...@@ -56,14 +59,18 @@ class ServicesDelegate {
class ServicesCreator { class ServicesCreator {
public: public:
virtual bool CanCreateDatabaseManager() = 0; virtual bool CanCreateDatabaseManager() = 0;
#if !defined(OS_ANDROID)
virtual bool CanCreateDownloadProtectionService() = 0; virtual bool CanCreateDownloadProtectionService() = 0;
#endif
virtual bool CanCreateIncidentReportingService() = 0; virtual bool CanCreateIncidentReportingService() = 0;
virtual bool CanCreateResourceRequestDetector() = 0; virtual bool CanCreateResourceRequestDetector() = 0;
// Caller takes ownership of the returned object. Cannot use std::unique_ptr // Caller takes ownership of the returned object. Cannot use std::unique_ptr
// because services may not be implemented for some build configs. // because services may not be implemented for some build configs.
virtual SafeBrowsingDatabaseManager* CreateDatabaseManager() = 0; virtual SafeBrowsingDatabaseManager* CreateDatabaseManager() = 0;
#if !defined(OS_ANDROID)
virtual DownloadProtectionService* CreateDownloadProtectionService() = 0; virtual DownloadProtectionService* CreateDownloadProtectionService() = 0;
#endif
virtual IncidentReportingService* CreateIncidentReportingService() = 0; virtual IncidentReportingService* CreateIncidentReportingService() = 0;
virtual ResourceRequestDetector* CreateResourceRequestDetector() = 0; virtual ResourceRequestDetector* CreateResourceRequestDetector() = 0;
}; };
...@@ -110,8 +117,9 @@ class ServicesDelegate { ...@@ -110,8 +117,9 @@ class ServicesDelegate {
// Returns nullptr for any service that is not available. // Returns nullptr for any service that is not available.
virtual ClientSideDetectionService* GetCsdService() = 0; virtual ClientSideDetectionService* GetCsdService() = 0;
#if !defined(OS_ANDROID)
virtual DownloadProtectionService* GetDownloadService() = 0; virtual DownloadProtectionService* GetDownloadService() = 0;
#endif
virtual void StartOnIOThread( virtual void StartOnIOThread(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const V4ProtocolConfig& v4_config) = 0; const V4ProtocolConfig& v4_config) = 0;
......
...@@ -87,9 +87,11 @@ void TestSafeBrowsingService::SetV4ProtocolConfig( ...@@ -87,9 +87,11 @@ void TestSafeBrowsingService::SetV4ProtocolConfig(
bool TestSafeBrowsingService::CanCreateDatabaseManager() { bool TestSafeBrowsingService::CanCreateDatabaseManager() {
return !use_v4_local_db_manager_; return !use_v4_local_db_manager_;
} }
#if !defined(OS_ANDROID)
bool TestSafeBrowsingService::CanCreateDownloadProtectionService() { bool TestSafeBrowsingService::CanCreateDownloadProtectionService() {
return false; return false;
} }
#endif
bool TestSafeBrowsingService::CanCreateIncidentReportingService() { bool TestSafeBrowsingService::CanCreateIncidentReportingService() {
return true; return true;
} }
...@@ -107,11 +109,13 @@ SafeBrowsingDatabaseManager* TestSafeBrowsingService::CreateDatabaseManager() { ...@@ -107,11 +109,13 @@ SafeBrowsingDatabaseManager* TestSafeBrowsingService::CreateDatabaseManager() {
#endif // BUILDFLAG(FULL_SAFE_BROWSING) #endif // BUILDFLAG(FULL_SAFE_BROWSING)
} }
#if !defined(OS_ANDROID)
DownloadProtectionService* DownloadProtectionService*
TestSafeBrowsingService::CreateDownloadProtectionService() { TestSafeBrowsingService::CreateDownloadProtectionService() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return nullptr; return nullptr;
} }
#endif
IncidentReportingService* IncidentReportingService*
TestSafeBrowsingService::CreateIncidentReportingService() { TestSafeBrowsingService::CreateIncidentReportingService() {
#if BUILDFLAG(FULL_SAFE_BROWSING) #if BUILDFLAG(FULL_SAFE_BROWSING)
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "build/build_config.h"
#include "chrome/browser/safe_browsing/ui_manager.h" #include "chrome/browser/safe_browsing/ui_manager.h"
#include "components/safe_browsing/db/v4_protocol_manager_util.h" #include "components/safe_browsing/db/v4_protocol_manager_util.h"
...@@ -70,11 +71,15 @@ class TestSafeBrowsingService : public SafeBrowsingService, ...@@ -70,11 +71,15 @@ class TestSafeBrowsingService : public SafeBrowsingService,
// ServicesDelegate::ServicesCreator: // ServicesDelegate::ServicesCreator:
bool CanCreateDatabaseManager() override; bool CanCreateDatabaseManager() override;
#if !defined(OS_ANDROID)
bool CanCreateDownloadProtectionService() override; bool CanCreateDownloadProtectionService() override;
#endif
bool CanCreateIncidentReportingService() override; bool CanCreateIncidentReportingService() override;
bool CanCreateResourceRequestDetector() override; bool CanCreateResourceRequestDetector() override;
SafeBrowsingDatabaseManager* CreateDatabaseManager() override; SafeBrowsingDatabaseManager* CreateDatabaseManager() override;
#if !defined(OS_ANDROID)
DownloadProtectionService* CreateDownloadProtectionService() override; DownloadProtectionService* CreateDownloadProtectionService() override;
#endif
IncidentReportingService* CreateIncidentReportingService() override; IncidentReportingService* CreateIncidentReportingService() override;
ResourceRequestDetector* CreateResourceRequestDetector() 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