OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 10 #pragma once |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // true if an error occurs. This method is expected to be called on the IO | 201 // true if an error occurs. This method is expected to be called on the IO |
202 // thread. | 202 // thread. |
203 virtual bool MatchCsdWhitelistUrl(const GURL& url); | 203 virtual bool MatchCsdWhitelistUrl(const GURL& url); |
204 | 204 |
205 // Check if the |url| matches any of the full-length hashes from the | 205 // Check if the |url| matches any of the full-length hashes from the |
206 // download whitelist. Returns true if there was a match and false otherwise. | 206 // download whitelist. Returns true if there was a match and false otherwise. |
207 // To make sure we are conservative we will return true if an error occurs. | 207 // To make sure we are conservative we will return true if an error occurs. |
208 // This method is expected to be called on the IO thread. | 208 // This method is expected to be called on the IO thread. |
209 virtual bool MatchDownloadWhitelistUrl(const GURL& url); | 209 virtual bool MatchDownloadWhitelistUrl(const GURL& url); |
210 | 210 |
| 211 // Check if |str| matches any of the full-length hashes from the download |
| 212 // whitelist. Returns true if there was a match and false otherwise. |
| 213 // To make sure we are conservative we will return true if an error occurs. |
| 214 // This method is expected to be called on the IO thread. |
| 215 virtual bool MatchDownloadWhitelistString(const std::string& str); |
| 216 |
211 // Called on the IO thread to cancel a pending check if the result is no | 217 // Called on the IO thread to cancel a pending check if the result is no |
212 // longer needed. | 218 // longer needed. |
213 void CancelCheck(Client* client); | 219 void CancelCheck(Client* client); |
214 | 220 |
215 // Called on the IO thread to display an interstitial page. | 221 // Called on the IO thread to display an interstitial page. |
216 // |url| is the url of the resource that matches a safe browsing list. | 222 // |url| is the url of the resource that matches a safe browsing list. |
217 // If the request contained a chain of redirects, |url| is the last url | 223 // If the request contained a chain of redirects, |url| is the last url |
218 // in the chain, and |original_url| is the first one (the root of the | 224 // in the chain, and |original_url| is the first one (the root of the |
219 // chain). Otherwise, |original_url| = |url|. | 225 // chain). Otherwise, |original_url| = |url|. |
220 void DisplayBlockingPage(const GURL& url, | 226 void DisplayBlockingPage(const GURL& url, |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 class SafeBrowsingServiceFactory { | 578 class SafeBrowsingServiceFactory { |
573 public: | 579 public: |
574 SafeBrowsingServiceFactory() { } | 580 SafeBrowsingServiceFactory() { } |
575 virtual ~SafeBrowsingServiceFactory() { } | 581 virtual ~SafeBrowsingServiceFactory() { } |
576 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 582 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
577 private: | 583 private: |
578 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 584 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
579 }; | 585 }; |
580 | 586 |
581 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 587 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |