| 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 // Helper class which handles communication with the SafeBrowsing backends for | 5 // Helper class which handles communication with the SafeBrowsing backends for |
| 6 // client-side phishing detection. This class is used to fetch the client-side | 6 // client-side phishing detection. This class is used to fetch the client-side |
| 7 // model and send it to all renderers. This class is also used to send a ping | 7 // model and send it to all renderers. This class is also used to send a ping |
| 8 // back to Google to verify if a particular site is really phishing or not. | 8 // back to Google to verify if a particular site is really phishing or not. |
| 9 // | 9 // |
| 10 // This class is not thread-safe and expects all calls to be made on the UI | 10 // This class is not thread-safe and expects all calls to be made on the UI |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // |bad_subnets| for faster lookups. This method is static to simplify | 244 // |bad_subnets| for faster lookups. This method is static to simplify |
| 245 // testing. | 245 // testing. |
| 246 static void SetBadSubnets(const ClientSideModel& model, | 246 static void SetBadSubnets(const ClientSideModel& model, |
| 247 BadSubnetMap* bad_subnets); | 247 BadSubnetMap* bad_subnets); |
| 248 | 248 |
| 249 | 249 |
| 250 // Returns true iff all the hash id's in the client-side model point to | 250 // Returns true iff all the hash id's in the client-side model point to |
| 251 // valid hashes in the model. | 251 // valid hashes in the model. |
| 252 static bool ModelHasValidHashIds(const ClientSideModel& model); | 252 static bool ModelHasValidHashIds(const ClientSideModel& model); |
| 253 | 253 |
| 254 // Returns the URL that will be used for phishing requests. |
| 255 static std::string GetClientReportPhishingUrl(); |
| 256 |
| 254 // Whether the service is running or not. When the service is not running, | 257 // Whether the service is running or not. When the service is not running, |
| 255 // it won't download the model nor report detected phishing URLs. | 258 // it won't download the model nor report detected phishing URLs. |
| 256 bool enabled_; | 259 bool enabled_; |
| 257 | 260 |
| 258 std::string model_str_; | 261 std::string model_str_; |
| 259 scoped_ptr<ClientSideModel> model_; | 262 scoped_ptr<ClientSideModel> model_; |
| 260 scoped_ptr<base::TimeDelta> model_max_age_; | 263 scoped_ptr<base::TimeDelta> model_max_age_; |
| 261 scoped_ptr<net::URLFetcher> model_fetcher_; | 264 scoped_ptr<net::URLFetcher> model_fetcher_; |
| 262 | 265 |
| 263 // Map of client report phishing request to the corresponding callback that | 266 // Map of client report phishing request to the corresponding callback that |
| (...skipping 29 matching lines...) Expand all Loading... |
| 293 // this map to speed up lookups. | 296 // this map to speed up lookups. |
| 294 BadSubnetMap bad_subnets_; | 297 BadSubnetMap bad_subnets_; |
| 295 | 298 |
| 296 content::NotificationRegistrar registrar_; | 299 content::NotificationRegistrar registrar_; |
| 297 | 300 |
| 298 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); | 301 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); |
| 299 }; | 302 }; |
| 300 } // namepsace safe_browsing | 303 } // namepsace safe_browsing |
| 301 | 304 |
| 302 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ | 305 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ |
| OLD | NEW |