| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Implementation of the SafeBrowsingDatabaseManager that sends URLs | 5 // Implementation of the SafeBrowsingDatabaseManager that sends URLs |
| 6 // via IPC to a database that chromium doesn't manage locally. | 6 // via IPC to a database that chromium doesn't manage locally. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_REMOTE_DATABASE_MANAGER_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_REMOTE_DATABASE_MANAGER_H_ |
| 9 #define CHROME_BROWSER_SAFE_BROWSING_REMOTE_DATABASE_MANAGER_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_REMOTE_DATABASE_MANAGER_H_ |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 // Construct RemoteSafeBrowsingDatabaseManager. | 24 // Construct RemoteSafeBrowsingDatabaseManager. |
| 25 // Must be initialized by calling StartOnIOThread() before using. | 25 // Must be initialized by calling StartOnIOThread() before using. |
| 26 RemoteSafeBrowsingDatabaseManager(); | 26 RemoteSafeBrowsingDatabaseManager(); |
| 27 | 27 |
| 28 // | 28 // |
| 29 // SafeBrowsingDatabaseManager implementation | 29 // SafeBrowsingDatabaseManager implementation |
| 30 // | 30 // |
| 31 | 31 |
| 32 bool IsSupported() const override; | 32 bool IsSupported() const override; |
| 33 bool ChecksAreAlwaysAsync() const override; |
| 34 bool CanCheckResourceType(content::ResourceType resource_type) const override; |
| 33 bool CanCheckUrl(const GURL& url) const override; | 35 bool CanCheckUrl(const GURL& url) const override; |
| 34 bool download_protection_enabled() const override; | 36 bool download_protection_enabled() const override; |
| 35 bool CheckBrowseUrl(const GURL& url, Client* client) override; | 37 bool CheckBrowseUrl(const GURL& url, Client* client) override; |
| 36 void CancelCheck(Client* client) override; | 38 void CancelCheck(Client* client) override; |
| 37 void StartOnIOThread() override; | 39 void StartOnIOThread() override; |
| 38 void StopOnIOThread(bool shutdown) override; | 40 void StopOnIOThread(bool shutdown) override; |
| 39 | 41 |
| 40 // These will fail with DCHECK() since their functionality isn't implemented. | 42 // These will fail with DCHECK() since their functionality isn't implemented. |
| 41 // We may later add support for a subset of them. | 43 // We may later add support for a subset of them. |
| 42 bool CheckDownloadUrl(const std::vector<GURL>& url_chain, | 44 bool CheckDownloadUrl(const std::vector<GURL>& url_chain, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 // | 58 // |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 ~RemoteSafeBrowsingDatabaseManager() override; | 61 ~RemoteSafeBrowsingDatabaseManager() override; |
| 60 class ClientRequest; // Per-request tracker. | 62 class ClientRequest; // Per-request tracker. |
| 61 | 63 |
| 62 // Requests currently outstanding. This owns the ptrs. | 64 // Requests currently outstanding. This owns the ptrs. |
| 63 std::vector<ClientRequest*> current_requests_; | 65 std::vector<ClientRequest*> current_requests_; |
| 64 bool enabled_; | 66 bool enabled_; |
| 65 | 67 |
| 68 std::set<content::ResourceType> resource_types_to_check_; |
| 69 bool is_android_field_trial_enabled_; |
| 70 |
| 66 friend class base::RefCountedThreadSafe<RemoteSafeBrowsingDatabaseManager>; | 71 friend class base::RefCountedThreadSafe<RemoteSafeBrowsingDatabaseManager>; |
| 67 DISALLOW_COPY_AND_ASSIGN(RemoteSafeBrowsingDatabaseManager); | 72 DISALLOW_COPY_AND_ASSIGN(RemoteSafeBrowsingDatabaseManager); |
| 68 }; // class RemoteSafeBrowsingDatabaseManager | 73 }; // class RemoteSafeBrowsingDatabaseManager |
| 69 | 74 |
| 70 #endif // CHROME_BROWSER_SAFE_BROWSING_REMOTE_DATABASE_MANAGER_H_ | 75 #endif // CHROME_BROWSER_SAFE_BROWSING_REMOTE_DATABASE_MANAGER_H_ |
| OLD | NEW |