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

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

Issue 11615011: Small modifications to safebrowsing code to make it simpler to add the extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compiler Created 7 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
Index: chrome/browser/safe_browsing/safe_browsing_util.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc
index 28302e0acd81d684801e3b9df02129c9817feae1..3951484affab93fc47bafea64115de55988ee8bb 100644
--- a/chrome/browser/safe_browsing/safe_browsing_util.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_util.cc
@@ -164,8 +164,8 @@ const char kBinHashList[] = "goog-badbin-digestvar-disabled";
const char kCsdWhiteList[] = "goog-csdwhite-sha256";
const char kDownloadWhiteList[] = "goog-downloadwhite-digest256";
-int GetListId(const std::string& name) {
- int id;
+ListType GetListId(const std::string& name) {
+ ListType id;
if (name == safe_browsing_util::kMalwareList) {
id = MALWARE;
} else if (name == safe_browsing_util::kPhishingList) {
@@ -184,7 +184,7 @@ int GetListId(const std::string& name) {
return id;
}
-bool GetListName(int list_id, std::string* list) {
+bool GetListName(ListType list_id, std::string* list) {
switch (list_id) {
case MALWARE:
*list = safe_browsing_util::kMalwareList;
@@ -490,13 +490,16 @@ GURL GeneratePhishingReportUrl(const std::string& report_page,
return google_util::AppendGoogleLocaleParam(report_url);
}
-void StringToSBFullHash(const std::string& hash_in, SBFullHash* hash_out) {
+SBFullHash StringToSBFullHash(const std::string& hash_in) {
DCHECK_EQ(crypto::kSHA256Length, hash_in.size());
- memcpy(hash_out->full_hash, hash_in.data(), crypto::kSHA256Length);
+ SBFullHash hash_out;
+ memcpy(hash_out.full_hash, hash_in.data(), crypto::kSHA256Length);
+ return hash_out;
}
std::string SBFullHashToString(const SBFullHash& hash) {
DCHECK_EQ(crypto::kSHA256Length, sizeof(hash.full_hash));
return std::string(hash.full_hash, sizeof(hash.full_hash));
}
+
} // namespace safe_browsing_util

Powered by Google App Engine
This is Rietveld 408576698