Index: components/safe_browsing_db/v4_protocol_manager_util.cc |
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.cc b/components/safe_browsing_db/v4_protocol_manager_util.cc |
index fde1c4aaaf6b710cdbcd8227a0df9a850e1c1b9b..e5e4f01255bf6810e0a059b01cf87d4231230435 100644 |
--- a/components/safe_browsing_db/v4_protocol_manager_util.cc |
+++ b/components/safe_browsing_db/v4_protocol_manager_util.cc |
@@ -16,6 +16,13 @@ using base::TimeDelta; |
namespace safe_browsing { |
+std::ostream& operator<<(std::ostream& os, const UpdateListIdentifier& id) { |
+ os << "{hash: " << id.hash() << "; platform_type: " << id.platform_type |
+ << "; threat_entry_type: " << id.threat_entry_type |
+ << "; threat_type: " << id.threat_type << "}"; |
+ return os; |
+} |
+ |
// The Safe Browsing V4 server URL prefix. |
const char kSbV4UrlPrefix[] = "https://safebrowsing.googleapis.com/v4"; |
@@ -38,6 +45,24 @@ size_t UpdateListIdentifier::hash() const { |
return base::HashInts(interim, third); |
} |
+UpdateListIdentifier::UpdateListIdentifier() {} |
+ |
+UpdateListIdentifier::UpdateListIdentifier(PlatformType platform_type, |
+ ThreatEntryType threat_entry_type, |
+ ThreatType threat_type) |
+ : platform_type(platform_type), |
+ threat_entry_type(threat_entry_type), |
+ threat_type(threat_type) { |
+ DCHECK(PlatformType_IsValid(platform_type)); |
+ DCHECK(ThreatEntryType_IsValid(threat_entry_type)); |
+ DCHECK(ThreatType_IsValid(threat_type)); |
+} |
+ |
+UpdateListIdentifier::UpdateListIdentifier(const ListUpdateResponse& response) |
+ : UpdateListIdentifier(response.platform_type(), |
+ response.threat_entry_type(), |
+ response.threat_type()) {} |
+ |
V4ProtocolConfig::V4ProtocolConfig() : disable_auto_update(false) {} |
V4ProtocolConfig::V4ProtocolConfig(const V4ProtocolConfig& other) = default; |