| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ |
| 7 | 7 |
| 8 // A class that provides the interface between the SafeBrowsing protocol manager | 8 // A class that provides the interface between the SafeBrowsing protocol manager |
| 9 // and database that holds the downloaded updates. | 9 // and database that holds the downloaded updates. |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 bool MatchCsdWhitelistUrl(const GURL& url) override; | 51 bool MatchCsdWhitelistUrl(const GURL& url) override; |
| 52 bool MatchMalwareIP(const std::string& ip_address) override; | 52 bool MatchMalwareIP(const std::string& ip_address) override; |
| 53 bool MatchDownloadWhitelistUrl(const GURL& url) override; | 53 bool MatchDownloadWhitelistUrl(const GURL& url) override; |
| 54 bool MatchDownloadWhitelistString(const std::string& str) override; | 54 bool MatchDownloadWhitelistString(const std::string& str) override; |
| 55 bool MatchModuleWhitelistString(const std::string& str) override; | 55 bool MatchModuleWhitelistString(const std::string& str) override; |
| 56 bool CheckResourceUrl(const GURL& url, Client* client) override; | 56 bool CheckResourceUrl(const GURL& url, Client* client) override; |
| 57 bool IsMalwareKillSwitchOn() override; | 57 bool IsMalwareKillSwitchOn() override; |
| 58 bool IsCsdWhitelistKillSwitchOn() override; | 58 bool IsCsdWhitelistKillSwitchOn() override; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 friend class V4LocalDatabaseManagerTest; |
| 62 void SetTaskRunnerForTest( |
| 63 const scoped_refptr<base::SequencedTaskRunner>& task_runner) { |
| 64 task_runner_ = task_runner; |
| 65 } |
| 66 |
| 61 ~V4LocalDatabaseManager() override; | 67 ~V4LocalDatabaseManager() override; |
| 62 | 68 |
| 63 // The callback called each time the protocol manager downloads updates | 69 // The callback called each time the protocol manager downloads updates |
| 64 // successfully. | 70 // successfully. |
| 65 void UpdateRequestCompleted( | 71 void UpdateRequestCompleted( |
| 66 std::unique_ptr<ParsedServerResponse> parsed_server_response); | 72 std::unique_ptr<ParsedServerResponse> parsed_server_response); |
| 67 | 73 |
| 68 void SetupUpdateProtocolManager( | 74 void SetupUpdateProtocolManager( |
| 69 net::URLRequestContextGetter* request_context_getter, | 75 net::URLRequestContextGetter* request_context_getter, |
| 70 const V4ProtocolConfig& config); | 76 const V4ProtocolConfig& config); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // The sequenced task runner for running safe browsing database operations. | 108 // The sequenced task runner for running safe browsing database operations. |
| 103 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 109 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 104 | 110 |
| 105 friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>; | 111 friend class base::RefCountedThreadSafe<V4LocalDatabaseManager>; |
| 106 DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager); | 112 DISALLOW_COPY_AND_ASSIGN(V4LocalDatabaseManager); |
| 107 }; // class V4LocalDatabaseManager | 113 }; // class V4LocalDatabaseManager |
| 108 | 114 |
| 109 } // namespace safe_browsing | 115 } // namespace safe_browsing |
| 110 | 116 |
| 111 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ | 117 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_LOCAL_DATABASE_MANAGER_H_ |
| OLD | NEW |