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

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

Issue 42553002: Mostly integrate new malware IP blacklist with the csd client. When (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix leaks in the unit-tests Created 7 years, 1 month 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Returns true if the given IP address string falls within a private 116 // Returns true if the given IP address string falls within a private
117 // (unroutable) network block. Pages which are hosted on these IP addresses 117 // (unroutable) network block. Pages which are hosted on these IP addresses
118 // are exempt from client-side phishing detection. This is called by the 118 // are exempt from client-side phishing detection. This is called by the
119 // ClientSideDetectionHost prior to sending the renderer a 119 // ClientSideDetectionHost prior to sending the renderer a
120 // SafeBrowsingMsg_StartPhishingDetection IPC. 120 // SafeBrowsingMsg_StartPhishingDetection IPC.
121 // 121 //
122 // ip_address should be a dotted IPv4 address, or an unbracketed IPv6 122 // ip_address should be a dotted IPv4 address, or an unbracketed IPv6
123 // address. 123 // address.
124 virtual bool IsPrivateIPAddress(const std::string& ip_address) const; 124 virtual bool IsPrivateIPAddress(const std::string& ip_address) const;
125 125
126 // Returns true if the given IP address is on the list of known bad IPs.
127 // ip_address should be a dotted IPv4 address, or an unbracketed IPv6
128 // address.
129 virtual bool IsBadIpAddress(const std::string& ip_address) const;
130
131 // Returns true and sets is_phishing if url is in the cache and valid. 126 // Returns true and sets is_phishing if url is in the cache and valid.
132 virtual bool GetValidCachedResult(const GURL& url, bool* is_phishing); 127 virtual bool GetValidCachedResult(const GURL& url, bool* is_phishing);
133 128
134 // Returns true if the url is in the cache. 129 // Returns true if the url is in the cache.
135 virtual bool IsInCache(const GURL& url); 130 virtual bool IsInCache(const GURL& url);
136 131
137 // Returns true if we have sent more than kMaxReportsPerInterval phishing 132 // Returns true if we have sent more than kMaxReportsPerInterval phishing
138 // reports in the last kReportsInterval. 133 // reports in the last kReportsInterval.
139 virtual bool OverPhishingReportLimit(); 134 virtual bool OverPhishingReportLimit();
140 135
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // this map to speed up lookups. 334 // this map to speed up lookups.
340 BadSubnetMap bad_subnets_; 335 BadSubnetMap bad_subnets_;
341 336
342 content::NotificationRegistrar registrar_; 337 content::NotificationRegistrar registrar_;
343 338
344 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService); 339 DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService);
345 }; 340 };
346 } // namespace safe_browsing 341 } // namespace safe_browsing
347 342
348 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_ 343 #endif // CHROME_BROWSER_SAFE_BROWSING_CLIENT_SIDE_DETECTION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698