Chromium Code Reviews| 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 |
| 11 | 11 |
| 12 #include <deque> | 12 #include <deque> |
| 13 #include <map> | 13 #include <map> |
| 14 #include <set> | 14 #include <set> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/hash_tables.h" | 18 #include "base/hash_tables.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/memory/weak_ptr.h" | |
| 21 #include "base/observer_list.h" | 22 #include "base/observer_list.h" |
| 22 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
| 23 #include "base/task.h" | 24 #include "base/task.h" |
| 24 #include "base/time.h" | 25 #include "base/time.h" |
| 25 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 26 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 26 #include "content/common/notification_observer.h" | 27 #include "content/common/notification_observer.h" |
| 27 #include "content/common/notification_registrar.h" | 28 #include "content/common/notification_registrar.h" |
| 28 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
| 29 | 30 |
| 30 class MalwareDetails; | 31 class MalwareDetails; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 43 } | 44 } |
| 44 | 45 |
| 45 namespace safe_browsing { | 46 namespace safe_browsing { |
| 46 class ClientSideDetectionService; | 47 class ClientSideDetectionService; |
| 47 class DownloadProtectionService; | 48 class DownloadProtectionService; |
| 48 } | 49 } |
| 49 | 50 |
| 50 // Construction needs to happen on the main thread. | 51 // Construction needs to happen on the main thread. |
| 51 class SafeBrowsingService | 52 class SafeBrowsingService |
| 52 : public base::RefCountedThreadSafe<SafeBrowsingService>, | 53 : public base::RefCountedThreadSafe<SafeBrowsingService>, |
| 54 public base::SupportsWeakPtr<SafeBrowsingService>, | |
|
mattm
2011/10/19 18:54:12
Are you aiming to make SafeBrowsingService not ref
Brian Ryner
2011/10/19 19:20:11
So, the issue I'm trying to address here is that c
mattm
2011/10/19 20:04:10
Still thinking this through, but I think we could:
mattm
2011/10/19 20:06:07
Oh, the one thing I forgot to mention: Since we ar
| |
| 53 public NotificationObserver { | 55 public NotificationObserver { |
| 54 public: | 56 public: |
| 55 class Client; | 57 class Client; |
| 56 // Users of this service implement this interface to be notified | 58 // Users of this service implement this interface to be notified |
| 57 // asynchronously of the result. | 59 // asynchronously of the result. |
| 58 enum UrlCheckResult { | 60 enum UrlCheckResult { |
| 59 SAFE, | 61 SAFE, |
| 60 URL_PHISHING, | 62 URL_PHISHING, |
| 61 URL_MALWARE, | 63 URL_MALWARE, |
| 62 BINARY_MALWARE_URL, // Binary url leads to a malware. | 64 BINARY_MALWARE_URL, // Binary url leads to a malware. |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 class SafeBrowsingServiceFactory { | 567 class SafeBrowsingServiceFactory { |
| 566 public: | 568 public: |
| 567 SafeBrowsingServiceFactory() { } | 569 SafeBrowsingServiceFactory() { } |
| 568 virtual ~SafeBrowsingServiceFactory() { } | 570 virtual ~SafeBrowsingServiceFactory() { } |
| 569 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 571 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
| 570 private: | 572 private: |
| 571 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 573 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
| 572 }; | 574 }; |
| 573 | 575 |
| 574 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 576 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
| OLD | NEW |