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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_util.cc

Issue 16595: Ignore GetHash results for lists that we don't support. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_util.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_util.cc (revision 7554)
+++ chrome/browser/safe_browsing/safe_browsing_util.cc (working copy)
@@ -28,6 +28,26 @@
const char kMalwareList[] = "goog-malware-shavar";
const char kPhishingList[] = "goog-phish-shavar";
+int GetListId(const std::string& name) {
+ if (name == kMalwareList)
+ return MALWARE;
+ else if (name == kPhishingList)
+ return PHISH;
+
+ return -1;
+}
+
+std::string GetListName(int list_id) {
+ switch (list_id) {
+ case MALWARE:
+ return kMalwareList;
+ case PHISH:
+ return kPhishingList;
+ default:
+ return "";
+ }
+}
+
void GenerateHostsToCheck(const GURL& url, std::vector<std::string>* hosts) {
// Per Safe Browsing Protocol 2 spec, first we try the host. Then we try up
// to 4 hostnames starting with the last 5 components and successively
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698