| 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_DATABASE_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| 9 #define CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 // Check if |str| matches any of the full-length hashes from the download | 171 // Check if |str| matches any of the full-length hashes from the download |
| 172 // whitelist. Returns true if there was a match and false otherwise. | 172 // whitelist. Returns true if there was a match and false otherwise. |
| 173 // To make sure we are conservative we will return true if an error occurs. | 173 // To make sure we are conservative we will return true if an error occurs. |
| 174 // This method is expected to be called on the IO thread. | 174 // This method is expected to be called on the IO thread. |
| 175 virtual bool MatchDownloadWhitelistString(const std::string& str); | 175 virtual bool MatchDownloadWhitelistString(const std::string& str); |
| 176 | 176 |
| 177 // Check if the CSD malware IP matching kill switch is turned on. | 177 // Check if the CSD malware IP matching kill switch is turned on. |
| 178 virtual bool IsMalwareKillSwitchOn(); | 178 virtual bool IsMalwareKillSwitchOn(); |
| 179 | 179 |
| 180 // Check if the given IP address (either IPv4 or IPv6) matches the malware |
| 181 // IP blacklist. |
| 182 // This method is expected to be called on the IO thread. |
| 183 virtual bool MatchMalwareIP(const std::string& ip_address); |
| 184 |
| 180 // Called on the IO thread to cancel a pending check if the result is no | 185 // Called on the IO thread to cancel a pending check if the result is no |
| 181 // longer needed. | 186 // longer needed. |
| 182 void CancelCheck(Client* client); | 187 void CancelCheck(Client* client); |
| 183 | 188 |
| 184 // Called on the IO thread when the SafeBrowsingProtocolManager has received | 189 // Called on the IO thread when the SafeBrowsingProtocolManager has received |
| 185 // the full hash results for prefix hits detected in the database. | 190 // the full hash results for prefix hits detected in the database. |
| 186 void HandleGetHashResults( | 191 void HandleGetHashResults( |
| 187 SafeBrowsingCheck* check, | 192 SafeBrowsingCheck* check, |
| 188 const std::vector<SBFullHashResult>& full_hashes, | 193 const std::vector<SBFullHashResult>& full_hashes, |
| 189 bool can_cache); | 194 bool can_cache); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 417 |
| 413 std::deque<QueuedCheck> queued_checks_; | 418 std::deque<QueuedCheck> queued_checks_; |
| 414 | 419 |
| 415 // Timeout to use for safe browsing checks. | 420 // Timeout to use for safe browsing checks. |
| 416 base::TimeDelta check_timeout_; | 421 base::TimeDelta check_timeout_; |
| 417 | 422 |
| 418 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseManager); | 423 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseManager); |
| 419 }; | 424 }; |
| 420 | 425 |
| 421 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ | 426 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| OLD | NEW |