| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 class SafeBrowsingProtocolManager : public URLFetcher::Delegate { | 44 class SafeBrowsingProtocolManager : public URLFetcher::Delegate { |
| 45 // Testing friends: | 45 // Testing friends: |
| 46 FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestBackOffTimes); | 46 FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestBackOffTimes); |
| 47 FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestChunkStrings); | 47 FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestChunkStrings); |
| 48 FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestGetHashBackOffTimes); | 48 FRIEND_TEST(SafeBrowsingProtocolManagerTest, TestGetHashBackOffTimes); |
| 49 | 49 |
| 50 public: | 50 public: |
| 51 SafeBrowsingProtocolManager(SafeBrowsingService* sb_service, | 51 SafeBrowsingProtocolManager(SafeBrowsingService* sb_service, |
| 52 const std::string& client_name, |
| 52 const std::string& client_key, | 53 const std::string& client_key, |
| 53 const std::string& wrapped_key); | 54 const std::string& wrapped_key); |
| 54 ~SafeBrowsingProtocolManager(); | 55 ~SafeBrowsingProtocolManager(); |
| 55 | 56 |
| 56 // Set up the update schedule and internal state for making periodic requests | 57 // Set up the update schedule and internal state for making periodic requests |
| 57 // of the SafeBrowsing service. | 58 // of the SafeBrowsing service. |
| 58 void Initialize(); | 59 void Initialize(); |
| 59 | 60 |
| 60 // URLFetcher::Delegate interface. | 61 // URLFetcher::Delegate interface. |
| 61 virtual void OnURLFetchComplete(const URLFetcher* source, | 62 virtual void OnURLFetchComplete(const URLFetcher* source, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 226 |
| 226 // Used for measuring chunk request latency. | 227 // Used for measuring chunk request latency. |
| 227 base::Time chunk_request_start_; | 228 base::Time chunk_request_start_; |
| 228 | 229 |
| 229 // Track the size of each update (in bytes). | 230 // Track the size of each update (in bytes). |
| 230 int update_size_; | 231 int update_size_; |
| 231 | 232 |
| 232 // Track outstanding malware report fetchers for clean up. | 233 // Track outstanding malware report fetchers for clean up. |
| 233 std::set<const URLFetcher*> malware_reports_; | 234 std::set<const URLFetcher*> malware_reports_; |
| 234 | 235 |
| 236 // The safe browsing client name sent in each request. |
| 237 std::string client_name_; |
| 238 |
| 235 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager); | 239 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager); |
| 236 }; | 240 }; |
| 237 | 241 |
| 238 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 242 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| OLD | NEW |