| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Actual ServicesDelegate implementation. Create via | 21 // Actual ServicesDelegate implementation. Create via |
| 22 // ServicesDelegate::Create(). | 22 // ServicesDelegate::Create(). |
| 23 class ServicesDelegateImpl : public ServicesDelegate { | 23 class ServicesDelegateImpl : public ServicesDelegate { |
| 24 public: | 24 public: |
| 25 ServicesDelegateImpl(SafeBrowsingService* safe_browsing_service, | 25 ServicesDelegateImpl(SafeBrowsingService* safe_browsing_service, |
| 26 ServicesDelegate::ServicesCreator* services_creator); | 26 ServicesDelegate::ServicesCreator* services_creator); |
| 27 ~ServicesDelegateImpl() override; | 27 ~ServicesDelegateImpl() override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // ServicesDelegate: | 30 // ServicesDelegate: |
| 31 const scoped_refptr<V4LocalDatabaseManager>& v4_local_database_manager() |
| 32 const override; |
| 31 void Initialize() override; | 33 void Initialize() override; |
| 32 void InitializeCsdService( | 34 void InitializeCsdService( |
| 33 net::URLRequestContextGetter* context_getter) override; | 35 net::URLRequestContextGetter* context_getter) override; |
| 34 void ShutdownServices() override; | 36 void ShutdownServices() override; |
| 35 void RefreshState(bool enable) override; | 37 void RefreshState(bool enable) override; |
| 36 void ProcessResourceRequest(const ResourceRequestInfo* request) override; | 38 void ProcessResourceRequest(const ResourceRequestInfo* request) override; |
| 37 std::unique_ptr<TrackedPreferenceValidationDelegate> | 39 std::unique_ptr<TrackedPreferenceValidationDelegate> |
| 38 CreatePreferenceValidationDelegate(Profile* profile) override; | 40 CreatePreferenceValidationDelegate(Profile* profile) override; |
| 39 void RegisterDelayedAnalysisCallback( | 41 void RegisterDelayedAnalysisCallback( |
| 40 const DelayedAnalysisCallback& callback) override; | 42 const DelayedAnalysisCallback& callback) override; |
| 41 void RegisterExtendedReportingOnlyDelayedAnalysisCallback( | 43 void RegisterExtendedReportingOnlyDelayedAnalysisCallback( |
| 42 const DelayedAnalysisCallback& callback) override; | 44 const DelayedAnalysisCallback& callback) override; |
| 43 void AddDownloadManager(content::DownloadManager* download_manager) override; | 45 void AddDownloadManager(content::DownloadManager* download_manager) override; |
| 44 ClientSideDetectionService* GetCsdService() override; | 46 ClientSideDetectionService* GetCsdService() override; |
| 45 DownloadProtectionService* GetDownloadService() override; | 47 DownloadProtectionService* GetDownloadService() override; |
| 46 | 48 |
| 47 void StartOnIOThread( | 49 void StartOnIOThread( |
| 48 net::URLRequestContextGetter* url_request_context_getter, | 50 net::URLRequestContextGetter* url_request_context_getter, |
| 49 const V4ProtocolConfig& v4_config) override; | 51 const V4ProtocolConfig& v4_config) override; |
| 50 void StopOnIOThread(bool shutdown) override; | 52 void StopOnIOThread(bool shutdown) override; |
| 51 | 53 |
| 52 // Is the Pver4 database manager enabled? Controlled by Finch. | |
| 53 bool IsV4LocalDatabaseManagerEnabled(); | |
| 54 | |
| 55 V4LocalDatabaseManager* CreateV4LocalDatabaseManager(); | |
| 56 | |
| 57 DownloadProtectionService* CreateDownloadProtectionService(); | 54 DownloadProtectionService* CreateDownloadProtectionService(); |
| 58 IncidentReportingService* CreateIncidentReportingService(); | 55 IncidentReportingService* CreateIncidentReportingService(); |
| 59 ResourceRequestDetector* CreateResourceRequestDetector(); | 56 ResourceRequestDetector* CreateResourceRequestDetector(); |
| 60 | 57 |
| 61 std::unique_ptr<ClientSideDetectionService> csd_service_; | 58 std::unique_ptr<ClientSideDetectionService> csd_service_; |
| 62 std::unique_ptr<DownloadProtectionService> download_service_; | 59 std::unique_ptr<DownloadProtectionService> download_service_; |
| 63 std::unique_ptr<IncidentReportingService> incident_service_; | 60 std::unique_ptr<IncidentReportingService> incident_service_; |
| 64 std::unique_ptr<ResourceRequestDetector> resource_request_detector_; | 61 std::unique_ptr<ResourceRequestDetector> resource_request_detector_; |
| 65 | 62 |
| 66 SafeBrowsingService* const safe_browsing_service_; | 63 SafeBrowsingService* const safe_browsing_service_; |
| 67 ServicesDelegate::ServicesCreator* const services_creator_; | 64 ServicesDelegate::ServicesCreator* const services_creator_; |
| 68 | 65 |
| 69 // The Pver4 local database manager handles the database and download logic | 66 // The Pver4 local database manager handles the database and download logic |
| 70 // Accessed on both UI and IO thread. | 67 // Accessed on both UI and IO thread. |
| 71 scoped_refptr<V4LocalDatabaseManager> v4_local_database_manager_; | 68 scoped_refptr<V4LocalDatabaseManager> v4_local_database_manager_; |
| 72 | 69 |
| 73 DISALLOW_COPY_AND_ASSIGN(ServicesDelegateImpl); | 70 DISALLOW_COPY_AND_ASSIGN(ServicesDelegateImpl); |
| 74 }; | 71 }; |
| 75 | 72 |
| 76 } // namespace safe_browsing | 73 } // namespace safe_browsing |
| 77 | 74 |
| 78 #endif // CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ | 75 #endif // CHROME_BROWSER_SAFE_BROWSING_SERVICES_DELEGATE_IMPL_H_ |
| OLD | NEW |