OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The Safe Browsing service is responsible for downloading anti-phishing and | 5 // The Safe Browsing service is responsible for downloading anti-phishing and |
6 // anti-malware tables and checking urls against them. | 6 // anti-malware tables and checking urls against them. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class SafeBrowsingProtocolManager; | 56 class SafeBrowsingProtocolManager; |
57 class SafeBrowsingProtocolManagerDelegate; | 57 class SafeBrowsingProtocolManagerDelegate; |
58 class SafeBrowsingServiceFactory; | 58 class SafeBrowsingServiceFactory; |
59 class SafeBrowsingUIManager; | 59 class SafeBrowsingUIManager; |
60 class SafeBrowsingURLRequestContextGetter; | 60 class SafeBrowsingURLRequestContextGetter; |
61 | 61 |
62 #if defined(FULL_SAFE_BROWSING) | 62 #if defined(FULL_SAFE_BROWSING) |
63 class IncidentReportingService; | 63 class IncidentReportingService; |
64 class OffDomainInclusionDetector; | 64 class OffDomainInclusionDetector; |
65 class ResourceRequestDetector; | 65 class ResourceRequestDetector; |
| 66 class ModuleLoadAnalyzer; |
66 #endif | 67 #endif |
67 | 68 |
68 // Construction needs to happen on the main thread. | 69 // Construction needs to happen on the main thread. |
69 // The SafeBrowsingService owns both the UI and Database managers which do | 70 // The SafeBrowsingService owns both the UI and Database managers which do |
70 // the heavylifting of safebrowsing service. Both of these managers stay | 71 // the heavylifting of safebrowsing service. Both of these managers stay |
71 // alive until SafeBrowsingService is destroyed, however, they are disabled | 72 // alive until SafeBrowsingService is destroyed, however, they are disabled |
72 // permanently when Shutdown method is called. | 73 // permanently when Shutdown method is called. |
73 class SafeBrowsingService | 74 class SafeBrowsingService |
74 : public base::RefCountedThreadSafe< | 75 : public base::RefCountedThreadSafe< |
75 SafeBrowsingService, | 76 SafeBrowsingService, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // incident reporting service for validation failures. Returns NULL if the | 142 // incident reporting service for validation failures. Returns NULL if the |
142 // service is not applicable for the given profile. | 143 // service is not applicable for the given profile. |
143 scoped_ptr<TrackedPreferenceValidationDelegate> | 144 scoped_ptr<TrackedPreferenceValidationDelegate> |
144 CreatePreferenceValidationDelegate(Profile* profile) const; | 145 CreatePreferenceValidationDelegate(Profile* profile) const; |
145 | 146 |
146 #if defined(FULL_SAFE_BROWSING) | 147 #if defined(FULL_SAFE_BROWSING) |
147 // Registers |callback| to be run after some delay following process launch. | 148 // Registers |callback| to be run after some delay following process launch. |
148 // |callback| will be dropped if the service is not applicable for the | 149 // |callback| will be dropped if the service is not applicable for the |
149 // process. | 150 // process. |
150 void RegisterDelayedAnalysisCallback(const DelayedAnalysisCallback& callback); | 151 void RegisterDelayedAnalysisCallback(const DelayedAnalysisCallback& callback); |
| 152 void RegisterExtendedReportingOnlyDelayedAnalysisCallback( |
| 153 const DelayedAnalysisCallback& callback); |
151 #endif | 154 #endif |
152 | 155 |
153 // Adds |download_manager| to the set monitored by safe browsing. | 156 // Adds |download_manager| to the set monitored by safe browsing. |
154 void AddDownloadManager(content::DownloadManager* download_manager); | 157 void AddDownloadManager(content::DownloadManager* download_manager); |
155 | 158 |
156 // Observes resource requests made by the renderer and reports suspicious | 159 // Observes resource requests made by the renderer and reports suspicious |
157 // activity. | 160 // activity. |
158 void OnResourceRequest(const net::URLRequest* request); | 161 void OnResourceRequest(const net::URLRequest* request); |
159 | 162 |
160 // Type for subscriptions to SafeBrowsing service state. | 163 // Type for subscriptions to SafeBrowsing service state. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // The UI manager handles showing interstitials. Accessed on both UI and IO | 305 // The UI manager handles showing interstitials. Accessed on both UI and IO |
303 // thread. | 306 // thread. |
304 scoped_refptr<SafeBrowsingUIManager> ui_manager_; | 307 scoped_refptr<SafeBrowsingUIManager> ui_manager_; |
305 | 308 |
306 // The database manager handles the database and download logic. Accessed on | 309 // The database manager handles the database and download logic. Accessed on |
307 // both UI and IO thread. | 310 // both UI and IO thread. |
308 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; | 311 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; |
309 | 312 |
310 #if defined(FULL_SAFE_BROWSING) | 313 #if defined(FULL_SAFE_BROWSING) |
311 scoped_ptr<ResourceRequestDetector> resource_request_detector_; | 314 scoped_ptr<ResourceRequestDetector> resource_request_detector_; |
| 315 |
| 316 scoped_ptr<ModuleLoadAnalyzer> module_load_analyzer_; |
312 #endif | 317 #endif |
313 | 318 |
314 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); | 319 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); |
315 }; | 320 }; |
316 | 321 |
317 // Factory for creating SafeBrowsingService. Useful for tests. | 322 // Factory for creating SafeBrowsingService. Useful for tests. |
318 class SafeBrowsingServiceFactory { | 323 class SafeBrowsingServiceFactory { |
319 public: | 324 public: |
320 SafeBrowsingServiceFactory() { } | 325 SafeBrowsingServiceFactory() { } |
321 virtual ~SafeBrowsingServiceFactory() { } | 326 virtual ~SafeBrowsingServiceFactory() { } |
322 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 327 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
323 private: | 328 private: |
324 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 329 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
325 }; | 330 }; |
326 | 331 |
327 } // namespace safe_browsing | 332 } // namespace safe_browsing |
328 | 333 |
329 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 334 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |