| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 10 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 // Clients that we've queued up for checking later once the database is ready. | 175 // Clients that we've queued up for checking later once the database is ready. |
| 176 struct QueuedCheck { | 176 struct QueuedCheck { |
| 177 Client* client; | 177 Client* client; |
| 178 GURL url; | 178 GURL url; |
| 179 base::Time start; | 179 base::Time start; |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 friend class base::RefCountedThreadSafe<SafeBrowsingService>; | 182 friend class base::RefCountedThreadSafe<SafeBrowsingService>; |
| 183 friend class SafeBrowsingServiceTest; |
| 183 | 184 |
| 184 ~SafeBrowsingService(); | 185 ~SafeBrowsingService(); |
| 185 | 186 |
| 186 // Called to initialize objects that are used on the io_thread. | 187 // Called to initialize objects that are used on the io_thread. |
| 187 void OnIOInitialize(const std::string& client_key, | 188 void OnIOInitialize(const std::string& client_key, |
| 188 const std::string& wrapped_key, | 189 const std::string& wrapped_key, |
| 189 URLRequestContextGetter* request_context_getter); | 190 URLRequestContextGetter* request_context_getter); |
| 190 | 191 |
| 191 // Called to shutdown operations on the io_thread. | 192 // Called to shutdown operations on the io_thread. |
| 192 void OnIOShutdown(); | 193 void OnIOShutdown(); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // Indicates if we're in the midst of trying to close the database. If this | 303 // Indicates if we're in the midst of trying to close the database. If this |
| 303 // is true, nothing on the IO thread should access the database. | 304 // is true, nothing on the IO thread should access the database. |
| 304 bool closing_database_; | 305 bool closing_database_; |
| 305 | 306 |
| 306 std::deque<QueuedCheck> queued_checks_; | 307 std::deque<QueuedCheck> queued_checks_; |
| 307 | 308 |
| 308 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); | 309 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService); |
| 309 }; | 310 }; |
| 310 | 311 |
| 311 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 312 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
| OLD | NEW |