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

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

Issue 7863006: Add a whitelist for the new binary download protection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fixes Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Utilities for the SafeBrowsing code. 5 // Utilities for the SafeBrowsing code.
6 6
7 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ 7 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_
8 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ 8 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_
9 #pragma once 9 #pragma once
10 10
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 namespace safe_browsing_util { 259 namespace safe_browsing_util {
260 260
261 // SafeBrowsing list names. 261 // SafeBrowsing list names.
262 extern const char kMalwareList[]; 262 extern const char kMalwareList[];
263 extern const char kPhishingList[]; 263 extern const char kPhishingList[];
264 // Binary Download list names. 264 // Binary Download list names.
265 extern const char kBinUrlList[]; 265 extern const char kBinUrlList[];
266 extern const char kBinHashList[]; 266 extern const char kBinHashList[];
267 // SafeBrowsing client-side detection whitelist list name. 267 // SafeBrowsing client-side detection whitelist list name.
268 extern const char kCsdWhiteList[]; 268 extern const char kCsdWhiteList[];
269 // SafeBrowsing download whitelist list name.
270 extern const char kDownloadWhiteList[];
269 271
270 enum ListType { 272 enum ListType {
271 INVALID = -1, 273 INVALID = -1,
272 MALWARE = 0, 274 MALWARE = 0,
273 PHISH = 1, 275 PHISH = 1,
274 BINURL = 2, 276 BINURL = 2,
275 BINHASH = 3, 277 BINHASH = 3,
276 CSDWHITELIST = 4, 278 CSDWHITELIST = 4,
279 DOWNLOADWHITELIST = 6,
mattm 2011/09/10 01:12:48 What happened to 5?
noelutz 2011/09/10 01:24:20 SafeBrowsing lists are stored in pairs. The list
277 }; 280 };
278 281
279 // Maps a list name to ListType. 282 // Maps a list name to ListType.
280 int GetListId(const std::string& name); 283 int GetListId(const std::string& name);
281 // Maps a ListId to list name. Return false if fails. 284 // Maps a ListId to list name. Return false if fails.
282 bool GetListName(int list_id, std::string* list); 285 bool GetListName(int list_id, std::string* list);
283 286
284 287
285 // Canonicalizes url as per Google Safe Browsing Specification. 288 // Canonicalizes url as per Google Safe Browsing Specification.
286 // See section 6.1 in 289 // See section 6.1 in
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 324
322 GURL GeneratePhishingReportUrl(const std::string& report_page, 325 GURL GeneratePhishingReportUrl(const std::string& report_page,
323 const std::string& url_to_report, 326 const std::string& url_to_report,
324 bool is_client_side_detection); 327 bool is_client_side_detection);
325 328
326 void StringToSBFullHash(const std::string& hash_in, SBFullHash* hash_out); 329 void StringToSBFullHash(const std::string& hash_in, SBFullHash* hash_out);
327 std::string SBFullHashToString(const SBFullHash& hash_out); 330 std::string SBFullHashToString(const SBFullHash& hash_out);
328 } // namespace safe_browsing_util 331 } // namespace safe_browsing_util
329 332
330 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ 333 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698