| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // If the SafeBrowsing service wants us to re-key, we clear our key state and | 145 // If the SafeBrowsing service wants us to re-key, we clear our key state and |
| 146 // issue the request. | 146 // issue the request. |
| 147 void HandleReKey(); | 147 void HandleReKey(); |
| 148 | 148 |
| 149 // Update internal state for each GetHash response error. | 149 // Update internal state for each GetHash response error. |
| 150 void HandleGetHashError(); | 150 void HandleGetHashError(); |
| 151 | 151 |
| 152 // Helper function for update completion. | 152 // Helper function for update completion. |
| 153 void UpdateFinished(bool success); | 153 void UpdateFinished(bool success); |
| 154 | 154 |
| 155 // A callback that runs if we timeout waiting for a response to an update |
| 156 // request. We use this to properly set our update state. |
| 157 void UpdateResponseTimeout(); |
| 158 |
| 155 private: | 159 private: |
| 156 // Main SafeBrowsing interface object. | 160 // Main SafeBrowsing interface object. |
| 157 SafeBrowsingService* sb_service_; | 161 SafeBrowsingService* sb_service_; |
| 158 | 162 |
| 159 // Current active request (in case we need to cancel) for updates or chunks | 163 // Current active request (in case we need to cancel) for updates or chunks |
| 160 // from the SafeBrowsing service. We can only have one of these outstanding | 164 // from the SafeBrowsing service. We can only have one of these outstanding |
| 161 // at any given time unlike GetHash requests, which are tracked separately. | 165 // at any given time unlike GetHash requests, which are tracked separately. |
| 162 scoped_ptr<URLFetcher> request_; | 166 scoped_ptr<URLFetcher> request_; |
| 163 | 167 |
| 164 // The kind of request that is currently in progress. | 168 // The kind of request that is currently in progress. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Track the size of each update (in bytes). | 235 // Track the size of each update (in bytes). |
| 232 int update_size_; | 236 int update_size_; |
| 233 | 237 |
| 234 // Track outstanding malware report fetchers for clean up. | 238 // Track outstanding malware report fetchers for clean up. |
| 235 std::set<const URLFetcher*> malware_reports_; | 239 std::set<const URLFetcher*> malware_reports_; |
| 236 | 240 |
| 237 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager); | 241 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager); |
| 238 }; | 242 }; |
| 239 | 243 |
| 240 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 244 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| OLD | NEW |