OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 void OnResetDatabase(); | 300 void OnResetDatabase(); |
301 | 301 |
302 // Store in-memory the GetHash response. Runs on the database thread. | 302 // Store in-memory the GetHash response. Runs on the database thread. |
303 void CacheHashResults(const std::vector<SBPrefix>& prefixes, | 303 void CacheHashResults(const std::vector<SBPrefix>& prefixes, |
304 const std::vector<SBFullHashResult>& full_hashes); | 304 const std::vector<SBFullHashResult>& full_hashes); |
305 | 305 |
306 // Internal worker function for processing full hashes. | 306 // Internal worker function for processing full hashes. |
307 void OnHandleGetHashResults(SafeBrowsingCheck* check, | 307 void OnHandleGetHashResults(SafeBrowsingCheck* check, |
308 const std::vector<SBFullHashResult>& full_hashes); | 308 const std::vector<SBFullHashResult>& full_hashes); |
309 | 309 |
310 void HandleOneCheck(SafeBrowsingCheck* check, | 310 // Run one check against |full_hashes|. Returns |true| if the check |
| 311 // finds a match in |full_hashes|. |
| 312 bool HandleOneCheck(SafeBrowsingCheck* check, |
311 const std::vector<SBFullHashResult>& full_hashes); | 313 const std::vector<SBFullHashResult>& full_hashes); |
312 | 314 |
313 // Invoked on the UI thread to show the blocking page. | 315 // Invoked on the UI thread to show the blocking page. |
314 void DoDisplayBlockingPage(const UnsafeResource& resource); | 316 void DoDisplayBlockingPage(const UnsafeResource& resource); |
315 | 317 |
316 // As soon as we create a blocking page, we schedule this method to | 318 // As soon as we create a blocking page, we schedule this method to |
317 // report hits to the malware or phishing list to the server. | 319 // report hits to the malware or phishing list to the server. |
318 void ReportSafeBrowsingHit(const GURL& malicious_url, | 320 void ReportSafeBrowsingHit(const GURL& malicious_url, |
319 const GURL& page_url, | 321 const GURL& page_url, |
320 const GURL& referrer_url, | 322 const GURL& referrer_url, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 class SafeBrowsingServiceFactory { | 387 class SafeBrowsingServiceFactory { |
386 public: | 388 public: |
387 SafeBrowsingServiceFactory() { } | 389 SafeBrowsingServiceFactory() { } |
388 virtual ~SafeBrowsingServiceFactory() { } | 390 virtual ~SafeBrowsingServiceFactory() { } |
389 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 391 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
390 private: | 392 private: |
391 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 393 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
392 }; | 394 }; |
393 | 395 |
394 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 396 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |