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 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "components/safe_browsing_db/util.h" | 18 #include "components/safe_browsing_db/util.h" |
19 #include "content/public/common/resource_type.h" | 19 #include "content/public/common/resource_type.h" |
20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
21 | 21 |
| 22 namespace safe_browsing { |
| 23 |
22 // Interface to either the locally-managed or a remotely-managed database. | 24 // Interface to either the locally-managed or a remotely-managed database. |
23 class SafeBrowsingDatabaseManager | 25 class SafeBrowsingDatabaseManager |
24 : public base::RefCountedThreadSafe<SafeBrowsingDatabaseManager> { | 26 : public base::RefCountedThreadSafe<SafeBrowsingDatabaseManager> { |
25 public: | 27 public: |
26 // Callers requesting a result should derive from this class. | 28 // Callers requesting a result should derive from this class. |
27 // The destructor should call db_manager->CancelCheck(client) if a | 29 // The destructor should call db_manager->CancelCheck(client) if a |
28 // request is still pending. | 30 // request is still pending. |
29 class Client { | 31 class Client { |
30 public: | 32 public: |
31 virtual ~Client() {} | 33 virtual ~Client() {} |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // multiple times during the life of the DatabaseManager. Must be called | 129 // multiple times during the life of the DatabaseManager. Must be called |
128 // on IO thread. If shutdown is true, the manager is disabled permanently. | 130 // on IO thread. If shutdown is true, the manager is disabled permanently. |
129 virtual void StopOnIOThread(bool shutdown) = 0; | 131 virtual void StopOnIOThread(bool shutdown) = 0; |
130 | 132 |
131 protected: | 133 protected: |
132 virtual ~SafeBrowsingDatabaseManager() {} | 134 virtual ~SafeBrowsingDatabaseManager() {} |
133 | 135 |
134 friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; | 136 friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; |
135 }; // class SafeBrowsingDatabaseManager | 137 }; // class SafeBrowsingDatabaseManager |
136 | 138 |
| 139 } // namespace safe_browsing |
| 140 |
137 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ | 141 #endif // CHROME_BROWSER_SAFE_BROWSING_DATABASE_MANAGER_H_ |
OLD | NEW |