| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Result will be passed to callback in |client|. | 140 // Result will be passed to callback in |client|. |
| 141 virtual bool CheckDownloadHash(const std::string& full_hash, Client* client); | 141 virtual bool CheckDownloadHash(const std::string& full_hash, Client* client); |
| 142 | 142 |
| 143 // Check which prefixes in |extension_ids| are in the safebrowsing blacklist. | 143 // Check which prefixes in |extension_ids| are in the safebrowsing blacklist. |
| 144 // Returns true if not, false if further checks need to be made in which case | 144 // Returns true if not, false if further checks need to be made in which case |
| 145 // the result will be passed to |client|. | 145 // the result will be passed to |client|. |
| 146 virtual bool CheckExtensionIDs(const std::set<std::string>& extension_ids, | 146 virtual bool CheckExtensionIDs(const std::set<std::string>& extension_ids, |
| 147 Client* client); | 147 Client* client); |
| 148 | 148 |
| 149 // Check if the given url is on the side-effect free whitelist. | 149 // Check if the given url is on the side-effect free whitelist. |
| 150 // Can be called on any thread. | 150 // Can be called on any thread. Returns false if the check cannot be performed |
| 151 // (e.g. because we are disabled or because of an invalid scheme in the URL). |
| 152 // Otherwise, returns true if the URL is on the whitelist based on matching |
| 153 // the hash prefix only (so there may be false positives). |
| 151 virtual bool CheckSideEffectFreeWhitelistUrl(const GURL& url); | 154 virtual bool CheckSideEffectFreeWhitelistUrl(const GURL& url); |
| 152 | 155 |
| 153 // Check if the |url| matches any of the full-length hashes from the | 156 // Check if the |url| matches any of the full-length hashes from the |
| 154 // client-side phishing detection whitelist. Returns true if there was a | 157 // client-side phishing detection whitelist. Returns true if there was a |
| 155 // match and false otherwise. To make sure we are conservative we will return | 158 // match and false otherwise. To make sure we are conservative we will return |
| 156 // true if an error occurs. This method is expected to be called on the IO | 159 // true if an error occurs. This method is expected to be called on the IO |
| 157 // thread. | 160 // thread. |
| 158 virtual bool MatchCsdWhitelistUrl(const GURL& url); | 161 virtual bool MatchCsdWhitelistUrl(const GURL& url); |
| 159 | 162 |
| 160 // Check if the |url| matches any of the full-length hashes from the | 163 // Check if the |url| matches any of the full-length hashes from the |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 398 |
| 396 std::deque<QueuedCheck> queued_checks_; | 399 std::deque<QueuedCheck> queued_checks_; |
| 397 | 400 |
| 398 // Timeout to use for safe browsing checks. | 401 // Timeout to use for safe browsing checks. |
| 399 base::TimeDelta check_timeout_; | 402 base::TimeDelta check_timeout_; |
| 400 | 403 |
| 401 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseManager); | 404 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseManager); |
| 402 }; | 405 }; |
| 403 | 406 |
| 404 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ | 407 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
| OLD | NEW |