| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 bool CheckBrowseUrl(const GURL& url, Client* client) override; | 113 bool CheckBrowseUrl(const GURL& url, Client* client) override; |
| 114 bool CheckDownloadUrl(const std::vector<GURL>& url_chain, | 114 bool CheckDownloadUrl(const std::vector<GURL>& url_chain, |
| 115 Client* client) override; | 115 Client* client) override; |
| 116 bool CheckExtensionIDs(const std::set<std::string>& extension_ids, | 116 bool CheckExtensionIDs(const std::set<std::string>& extension_ids, |
| 117 Client* client) override; | 117 Client* client) override; |
| 118 bool MatchCsdWhitelistUrl(const GURL& url) override; | 118 bool MatchCsdWhitelistUrl(const GURL& url) override; |
| 119 bool MatchMalwareIP(const std::string& ip_address) override; | 119 bool MatchMalwareIP(const std::string& ip_address) override; |
| 120 bool MatchDownloadWhitelistUrl(const GURL& url) override; | 120 bool MatchDownloadWhitelistUrl(const GURL& url) override; |
| 121 bool MatchDownloadWhitelistString(const std::string& str) override; | 121 bool MatchDownloadWhitelistString(const std::string& str) override; |
| 122 bool MatchInclusionWhitelistUrl(const GURL& url) override; | 122 bool MatchInclusionWhitelistUrl(const GURL& url) override; |
| 123 bool MatchModuleWhitelistString(const std::string& str) override; |
| 123 bool IsMalwareKillSwitchOn() override; | 124 bool IsMalwareKillSwitchOn() override; |
| 124 bool IsCsdWhitelistKillSwitchOn() override; | 125 bool IsCsdWhitelistKillSwitchOn() override; |
| 125 void CancelCheck(Client* client) override; | 126 void CancelCheck(Client* client) override; |
| 126 void StartOnIOThread() override; | 127 void StartOnIOThread() override; |
| 127 void StopOnIOThread(bool shutdown) override; | 128 void StopOnIOThread(bool shutdown) override; |
| 128 bool download_protection_enabled() const override; | 129 bool download_protection_enabled() const override; |
| 129 | 130 |
| 130 protected: | 131 protected: |
| 131 ~LocalSafeBrowsingDatabaseManager() override; | 132 ~LocalSafeBrowsingDatabaseManager() override; |
| 132 | 133 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 338 |
| 338 // Indicate if the extension blacklist should be enabled. | 339 // Indicate if the extension blacklist should be enabled. |
| 339 bool enable_extension_blacklist_; | 340 bool enable_extension_blacklist_; |
| 340 | 341 |
| 341 // Indicate if the csd malware IP blacklist should be enabled. | 342 // Indicate if the csd malware IP blacklist should be enabled. |
| 342 bool enable_ip_blacklist_; | 343 bool enable_ip_blacklist_; |
| 343 | 344 |
| 344 // Indicate if the unwanted software blacklist should be enabled. | 345 // Indicate if the unwanted software blacklist should be enabled. |
| 345 bool enable_unwanted_software_blacklist_; | 346 bool enable_unwanted_software_blacklist_; |
| 346 | 347 |
| 348 // Indicate if the module whitelist should be enabled. |
| 349 bool enable_module_whitelist_; |
| 350 |
| 347 // The sequenced task runner for running safe browsing database operations. | 351 // The sequenced task runner for running safe browsing database operations. |
| 348 scoped_refptr<base::SequencedTaskRunner> safe_browsing_task_runner_; | 352 scoped_refptr<base::SequencedTaskRunner> safe_browsing_task_runner_; |
| 349 | 353 |
| 350 // Indicates if we're currently in an update cycle. | 354 // Indicates if we're currently in an update cycle. |
| 351 bool update_in_progress_; | 355 bool update_in_progress_; |
| 352 | 356 |
| 353 // When true, newly fetched chunks may not in the database yet since the | 357 // When true, newly fetched chunks may not in the database yet since the |
| 354 // database is still updating. | 358 // database is still updating. |
| 355 bool database_update_in_progress_; | 359 bool database_update_in_progress_; |
| 356 | 360 |
| 357 // Indicates if we're in the midst of trying to close the database. If this | 361 // Indicates if we're in the midst of trying to close the database. If this |
| 358 // is true, nothing on the IO thread should access the database. | 362 // is true, nothing on the IO thread should access the database. |
| 359 bool closing_database_; | 363 bool closing_database_; |
| 360 | 364 |
| 361 std::deque<QueuedCheck> queued_checks_; | 365 std::deque<QueuedCheck> queued_checks_; |
| 362 | 366 |
| 363 // Timeout to use for safe browsing checks. | 367 // Timeout to use for safe browsing checks. |
| 364 base::TimeDelta check_timeout_; | 368 base::TimeDelta check_timeout_; |
| 365 | 369 |
| 366 DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingDatabaseManager); | 370 DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingDatabaseManager); |
| 367 }; // class LocalSafeBrowsingDatabaseManager | 371 }; // class LocalSafeBrowsingDatabaseManager |
| 368 | 372 |
| 369 } // namespace safe_browsing | 373 } // namespace safe_browsing |
| 370 | 374 |
| 371 #endif // CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ | 375 #endif // CHROME_BROWSER_SAFE_BROWSING_LOCAL_DATABASE_MANAGER_H_ |
| OLD | NEW |