Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: chrome/browser/safe_browsing/client_side_detection_service.h

Issue 23625015: Consolidate TestURLFetcherFactory::SetFakeResponse (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // testing. 279 // testing.
280 static void SetBadSubnets(const ClientSideModel& model, 280 static void SetBadSubnets(const ClientSideModel& model,
281 BadSubnetMap* bad_subnets); 281 BadSubnetMap* bad_subnets);
282 282
283 283
284 // Returns true iff all the hash id's in the client-side model point to 284 // Returns true iff all the hash id's in the client-side model point to
285 // valid hashes in the model. 285 // valid hashes in the model.
286 static bool ModelHasValidHashIds(const ClientSideModel& model); 286 static bool ModelHasValidHashIds(const ClientSideModel& model);
287 287
288 // Returns the URL that will be used for phishing requests. 288 // Returns the URL that will be used for phishing requests.
289 static std::string GetClientReportUrl(const std::string& report_url); 289 static GURL GetClientReportUrl(const std::string& report_url);
290 290
291 // Whether the service is running or not. When the service is not running, 291 // Whether the service is running or not. When the service is not running,
292 // it won't download the model nor report detected phishing URLs. 292 // it won't download the model nor report detected phishing URLs.
293 bool enabled_; 293 bool enabled_;
294 294
295 std::string model_str_; 295 std::string model_str_;
296 scoped_ptr<ClientSideModel> model_; 296 scoped_ptr<ClientSideModel> model_;
297 scoped_ptr<base::TimeDelta> model_max_age_; 297 scoped_ptr<base::TimeDelta> model_max_age_;
298 scoped_ptr<net::URLFetcher> model_fetcher_; 298 scoped_ptr<net::URLFetcher> model_fetcher_;
299 299
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 std::vector<AddressRange> private_networks_; 336 std::vector<AddressRange> private_networks_;
337 337
338 // Map of bad subnets which are copied from the client model and put into 338 // Map of bad subnets which are copied from the client model and put into
339 // this map to speed up lookups. 339 // this map to speed up lookups.
340 BadSubnetMap bad_subnets_; 340 BadSubnetMap bad_subnets_;
341 341
342 content::NotificationRegistrar registrar_; 342 content::NotificationRegistrar registrar_;
343 343
344 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); 344 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService);
345 }; 345 };
346 } // namepsace safe_browsing 346 } // namespace safe_browsing
347 347
348 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ 348 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698