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 |
11 | 11 |
12 #include <deque> | 12 #include <deque> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/hash_tables.h" | 17 #include "base/hash_tables.h" |
18 #include "base/lock.h" | |
19 #include "base/ref_counted.h" | 18 #include "base/ref_counted.h" |
20 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
| 20 #include "base/synchronization/lock.h" |
21 #include "base/time.h" | 21 #include "base/time.h" |
22 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 22 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
23 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
24 #include "webkit/glue/resource_type.h" | 24 #include "webkit/glue/resource_type.h" |
25 | 25 |
26 class MalwareDetails; | 26 class MalwareDetails; |
27 class PrefService; | 27 class PrefService; |
28 class SafeBrowsingDatabase; | 28 class SafeBrowsingDatabase; |
29 class SafeBrowsingProtocolManager; | 29 class SafeBrowsingProtocolManager; |
30 class SafeBrowsingServiceFactory; | 30 class SafeBrowsingServiceFactory; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 CurrentChecks checks_; | 338 CurrentChecks checks_; |
339 | 339 |
340 // Used for issuing only one GetHash request for a given prefix. | 340 // Used for issuing only one GetHash request for a given prefix. |
341 GetHashRequests gethash_requests_; | 341 GetHashRequests gethash_requests_; |
342 | 342 |
343 // The sqlite database. We don't use a scoped_ptr because it needs to be | 343 // The sqlite database. We don't use a scoped_ptr because it needs to be |
344 // destructed on a different thread than this object. | 344 // destructed on a different thread than this object. |
345 SafeBrowsingDatabase* database_; | 345 SafeBrowsingDatabase* database_; |
346 | 346 |
347 // Lock used to prevent possible data races due to compiler optimizations. | 347 // Lock used to prevent possible data races due to compiler optimizations. |
348 mutable Lock database_lock_; | 348 mutable base::Lock database_lock_; |
349 | 349 |
350 // Handles interaction with SafeBrowsing servers. | 350 // Handles interaction with SafeBrowsing servers. |
351 SafeBrowsingProtocolManager* protocol_manager_; | 351 SafeBrowsingProtocolManager* protocol_manager_; |
352 | 352 |
353 std::vector<WhiteListedEntry> white_listed_entries_; | 353 std::vector<WhiteListedEntry> white_listed_entries_; |
354 | 354 |
355 // Whether the service is running. 'enabled_' is used by SafeBrowsingService | 355 // Whether the service is running. 'enabled_' is used by SafeBrowsingService |
356 // on the IO thread during normal operations. | 356 // on the IO thread during normal operations. |
357 bool enabled_; | 357 bool enabled_; |
358 | 358 |
(...skipping 28 matching lines...) Expand all Loading... |
387 class SafeBrowsingServiceFactory { | 387 class SafeBrowsingServiceFactory { |
388 public: | 388 public: |
389 SafeBrowsingServiceFactory() { } | 389 SafeBrowsingServiceFactory() { } |
390 virtual ~SafeBrowsingServiceFactory() { } | 390 virtual ~SafeBrowsingServiceFactory() { } |
391 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 391 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
392 private: | 392 private: |
393 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 393 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
394 }; | 394 }; |
395 | 395 |
396 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 396 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
OLD | NEW |