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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class URLRequestContextGetter; | 43 class URLRequestContextGetter; |
44 } | 44 } |
45 | 45 |
46 namespace safe_browsing { | 46 namespace safe_browsing { |
47 class ClientSideDetectionService; | 47 class ClientSideDetectionService; |
48 class DownloadProtectionService; | 48 class DownloadProtectionService; |
49 } | 49 } |
50 | 50 |
51 // Construction needs to happen on the main thread. | 51 // Construction needs to happen on the main thread. |
52 class SafeBrowsingService | 52 class SafeBrowsingService |
53 : public base::RefCountedThreadSafe<SafeBrowsingService, | 53 : public base::RefCountedThreadSafe< |
54 BrowserThread::DeleteOnUIThread>, | 54 SafeBrowsingService, content::BrowserThread::DeleteOnUIThread>, |
55 public content::NotificationObserver { | 55 public content::NotificationObserver { |
56 public: | 56 public: |
57 class Client; | 57 class Client; |
58 // Users of this service implement this interface to be notified | 58 // Users of this service implement this interface to be notified |
59 // asynchronously of the result. | 59 // asynchronously of the result. |
60 enum UrlCheckResult { | 60 enum UrlCheckResult { |
61 SAFE, | 61 SAFE, |
62 URL_PHISHING, | 62 URL_PHISHING, |
63 URL_MALWARE, | 63 URL_MALWARE, |
64 BINARY_MALWARE_URL, // Binary url leads to a malware. | 64 BINARY_MALWARE_URL, // Binary url leads to a malware. |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // Used for whitelisting a render view when the user ignores our warning. | 322 // Used for whitelisting a render view when the user ignores our warning. |
323 struct WhiteListedEntry; | 323 struct WhiteListedEntry; |
324 | 324 |
325 // Clients that we've queued up for checking later once the database is ready. | 325 // Clients that we've queued up for checking later once the database is ready. |
326 struct QueuedCheck { | 326 struct QueuedCheck { |
327 Client* client; | 327 Client* client; |
328 GURL url; | 328 GURL url; |
329 base::TimeTicks start; // When check was queued. | 329 base::TimeTicks start; // When check was queued. |
330 }; | 330 }; |
331 | 331 |
332 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 332 friend struct content::BrowserThread::DeleteOnThread< |
| 333 content::BrowserThread::UI>; |
333 friend class DeleteTask<SafeBrowsingService>; | 334 friend class DeleteTask<SafeBrowsingService>; |
334 friend class SafeBrowsingServiceTest; | 335 friend class SafeBrowsingServiceTest; |
335 | 336 |
336 // Called to initialize objects that are used on the io_thread. | 337 // Called to initialize objects that are used on the io_thread. |
337 void OnIOInitialize(const std::string& client_key, | 338 void OnIOInitialize(const std::string& client_key, |
338 const std::string& wrapped_key, | 339 const std::string& wrapped_key, |
339 net::URLRequestContextGetter* request_context_getter); | 340 net::URLRequestContextGetter* request_context_getter); |
340 | 341 |
341 // Called to shutdown operations on the io_thread. | 342 // Called to shutdown operations on the io_thread. |
342 void OnIOShutdown(); | 343 void OnIOShutdown(); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 class SafeBrowsingServiceFactory { | 571 class SafeBrowsingServiceFactory { |
571 public: | 572 public: |
572 SafeBrowsingServiceFactory() { } | 573 SafeBrowsingServiceFactory() { } |
573 virtual ~SafeBrowsingServiceFactory() { } | 574 virtual ~SafeBrowsingServiceFactory() { } |
574 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 575 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
575 private: | 576 private: |
576 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 577 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
577 }; | 578 }; |
578 | 579 |
579 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 580 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |