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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 class ClientSideDetectionService; | 51 class ClientSideDetectionService; |
52 class DownloadProtectionService; | 52 class DownloadProtectionService; |
53 struct SafeBrowsingProtocolConfig; | 53 struct SafeBrowsingProtocolConfig; |
54 class SafeBrowsingDatabaseManager; | 54 class SafeBrowsingDatabaseManager; |
55 class SafeBrowsingPingManager; | 55 class SafeBrowsingPingManager; |
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 struct V4GetHashProtocolConfig; | |
61 | 62 |
62 #if defined(FULL_SAFE_BROWSING) | 63 #if defined(FULL_SAFE_BROWSING) |
63 class IncidentReportingService; | 64 class IncidentReportingService; |
64 class OffDomainInclusionDetector; | 65 class OffDomainInclusionDetector; |
65 class ResourceRequestDetector; | 66 class ResourceRequestDetector; |
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 |
(...skipping 23 matching lines...) Expand all Loading... | |
94 void Initialize(); | 95 void Initialize(); |
95 | 96 |
96 // Called on the main thread to let us know that the io_thread is going away. | 97 // Called on the main thread to let us know that the io_thread is going away. |
97 void ShutDown(); | 98 void ShutDown(); |
98 | 99 |
99 // Called on UI thread to decide if the download file's sha256 hash | 100 // Called on UI thread to decide if the download file's sha256 hash |
100 // should be calculated for safebrowsing. | 101 // should be calculated for safebrowsing. |
101 bool DownloadBinHashNeeded() const; | 102 bool DownloadBinHashNeeded() const; |
102 | 103 |
103 // Create a protocol config struct. | 104 // Create a protocol config struct. |
104 virtual SafeBrowsingProtocolConfig GetProtocolConfig() const; | 105 virtual SafeBrowsingProtocolConfig GetProtocolConfig() const; |
Nathan Parker
2016/02/17 15:53:28
Do these need to be public?
kcarattini
2016/02/18 02:55:29
Turns out yes -- blacklist_state_fetcher calls it.
| |
105 | 106 |
107 // Create a v4 protocol config struct. | |
108 virtual V4GetHashProtocolConfig GetV4GetHashProtocolConfig() const; | |
Nathan Parker
2016/02/17 15:53:28
I probably missed this before... but would this be
kcarattini
2016/02/17 22:44:42
I figured the Update config would need a lot more
| |
109 | |
110 // Returns the client_name field for both V3 and V4 protocol manager configs. | |
111 std::string GetProtocolConfigClientName() const; | |
112 | |
106 // Get current enabled status. Must be called on IO thread. | 113 // Get current enabled status. Must be called on IO thread. |
107 bool enabled() const { | 114 bool enabled() const { |
108 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 115 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
109 return enabled_; | 116 return enabled_; |
110 } | 117 } |
111 | 118 |
112 // Whether the service is enabled by the current set of profiles. | 119 // Whether the service is enabled by the current set of profiles. |
113 bool enabled_by_prefs() const { | 120 bool enabled_by_prefs() const { |
114 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 121 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
115 return enabled_by_prefs_; | 122 return enabled_by_prefs_; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 SafeBrowsingServiceFactory() { } | 316 SafeBrowsingServiceFactory() { } |
310 virtual ~SafeBrowsingServiceFactory() { } | 317 virtual ~SafeBrowsingServiceFactory() { } |
311 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 318 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
312 private: | 319 private: |
313 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 320 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
314 }; | 321 }; |
315 | 322 |
316 } // namespace safe_browsing | 323 } // namespace safe_browsing |
317 | 324 |
318 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 325 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |