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 // Safe Browsing Database Manager implementation that manages a local | 5 // Safe Browsing Database Manager implementation that manages a local |
6 // database. This is used by Desktop Chromium. | 6 // database. This is used by Desktop Chromium. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ |
9 #define CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 class URLRequestContext; | 34 class URLRequestContext; |
35 class URLRequestContextGetter; | 35 class URLRequestContextGetter; |
36 } | 36 } |
37 | 37 |
38 namespace safe_browsing { | 38 namespace safe_browsing { |
39 | 39 |
40 class SafeBrowsingService; | 40 class SafeBrowsingService; |
41 class SafeBrowsingDatabase; | 41 class SafeBrowsingDatabase; |
42 class ClientSideDetectionService; | 42 class ClientSideDetectionService; |
43 class DownloadProtectionService; | 43 class DownloadProtectionService; |
44 struct V4GetHashProtocolConfig; | 44 struct V4ProtocolConfig; |
45 | 45 |
46 // Implemetation that manages a local database on disk. | 46 // Implemetation that manages a local database on disk. |
47 // | 47 // |
48 // Construction needs to happen on the main thread. | 48 // Construction needs to happen on the main thread. |
49 class LocalSafeBrowsingDatabaseManager | 49 class LocalSafeBrowsingDatabaseManager |
50 : public SafeBrowsingDatabaseManager, | 50 : public SafeBrowsingDatabaseManager, |
51 public SafeBrowsingProtocolManagerDelegate { | 51 public SafeBrowsingProtocolManagerDelegate { |
52 public: | 52 public: |
53 // Bundle of SafeBrowsing state while performing a URL or hash prefix check. | 53 // Bundle of SafeBrowsing state while performing a URL or hash prefix check. |
54 struct SafeBrowsingCheck { | 54 struct SafeBrowsingCheck { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 }; | 102 }; |
103 | 103 |
104 // Use this constructor for testing only. | 104 // Use this constructor for testing only. |
105 explicit LocalSafeBrowsingDatabaseManager( | 105 explicit LocalSafeBrowsingDatabaseManager( |
106 const scoped_refptr<SafeBrowsingService>& service); | 106 const scoped_refptr<SafeBrowsingService>& service); |
107 | 107 |
108 // Creates the safe browsing service. Need to initialize before using. | 108 // Creates the safe browsing service. Need to initialize before using. |
109 LocalSafeBrowsingDatabaseManager( | 109 LocalSafeBrowsingDatabaseManager( |
110 const scoped_refptr<SafeBrowsingService>& service, | 110 const scoped_refptr<SafeBrowsingService>& service, |
111 net::URLRequestContextGetter* request_context_getter, | 111 net::URLRequestContextGetter* request_context_getter, |
112 const V4GetHashProtocolConfig& config); | 112 const V4ProtocolConfig& config); |
113 | 113 |
114 // | 114 // |
115 // SafeBrowsingDatabaseManager overrides | 115 // SafeBrowsingDatabaseManager overrides |
116 // | 116 // |
117 | 117 |
118 bool IsSupported() const override; | 118 bool IsSupported() const override; |
119 safe_browsing::ThreatSource GetThreatSource() const override; | 119 safe_browsing::ThreatSource GetThreatSource() const override; |
120 bool ChecksAreAlwaysAsync() const override; | 120 bool ChecksAreAlwaysAsync() const override; |
121 bool CanCheckResourceType(content::ResourceType resource_type) const override; | 121 bool CanCheckResourceType(content::ResourceType resource_type) const override; |
122 bool CanCheckUrl(const GURL& url) const override; | 122 bool CanCheckUrl(const GURL& url) const override; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 // Timeout to use for safe browsing checks. | 383 // Timeout to use for safe browsing checks. |
384 base::TimeDelta check_timeout_; | 384 base::TimeDelta check_timeout_; |
385 | 385 |
386 DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingDatabaseManager); | 386 DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingDatabaseManager); |
387 }; // class LocalSafeBrowsingDatabaseManager | 387 }; // class LocalSafeBrowsingDatabaseManager |
388 | 388 |
389 } // namespace safe_browsing | 389 } // namespace safe_browsing |
390 | 390 |
391 #endif // CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ | 391 #endif // CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ |
OLD | NEW |