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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
7 | 7 |
8 // A class that implements Chrome's interface with the SafeBrowsing protocol. | 8 // A class that implements Chrome's interface with the SafeBrowsing protocol. |
9 // The SafeBrowsingProtocolManager handles formatting and making requests of, | 9 // The SafeBrowsingProtocolManager handles formatting and making requests of, |
10 // and handling responses from, Google's SafeBrowsing servers. This class uses | 10 // and handling responses from, Google's SafeBrowsing servers. This class uses |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 const SafeBrowsingProtocolConfig& config); | 159 const SafeBrowsingProtocolConfig& config); |
160 | 160 |
161 private: | 161 private: |
162 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestBackOffTimes); | 162 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestBackOffTimes); |
163 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestChunkStrings); | 163 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestChunkStrings); |
164 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestGetHashUrl); | 164 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestGetHashUrl); |
165 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, | 165 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, |
166 TestGetHashBackOffTimes); | 166 TestGetHashBackOffTimes); |
167 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestNextChunkUrl); | 167 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestNextChunkUrl); |
168 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestUpdateUrl); | 168 FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestUpdateUrl); |
169 friend class SafeBrowsingServiceTest; | 169 friend class SafeBrowsingServerTest; |
170 friend class SBProtocolManagerFactoryImpl; | 170 friend class SBProtocolManagerFactoryImpl; |
171 | 171 |
172 // Internal API for fetching information from the SafeBrowsing servers. The | 172 // Internal API for fetching information from the SafeBrowsing servers. The |
173 // GetHash requests are higher priority since they can block user requests | 173 // GetHash requests are higher priority since they can block user requests |
174 // so are handled separately. | 174 // so are handled separately. |
175 enum SafeBrowsingRequestType { | 175 enum SafeBrowsingRequestType { |
176 NO_REQUEST = 0, // No requests in progress | 176 NO_REQUEST = 0, // No requests in progress |
177 UPDATE_REQUEST, // Request for redirect URLs | 177 UPDATE_REQUEST, // Request for redirect URLs |
178 CHUNK_REQUEST, // Request for a specific chunk | 178 CHUNK_REQUEST, // Request for a specific chunk |
179 }; | 179 }; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 // Add new chunks to the database. | 374 // Add new chunks to the database. |
375 virtual void AddChunks(const std::string& list, SBChunkList* chunks) = 0; | 375 virtual void AddChunks(const std::string& list, SBChunkList* chunks) = 0; |
376 | 376 |
377 // Delete chunks from the database. | 377 // Delete chunks from the database. |
378 virtual void DeleteChunks( | 378 virtual void DeleteChunks( |
379 std::vector<SBChunkDelete>* delete_chunks) = 0; | 379 std::vector<SBChunkDelete>* delete_chunks) = 0; |
380 }; | 380 }; |
381 | 381 |
382 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 382 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
OLD | NEW |