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

Unified Diff: components/safe_browsing_db/v4_protocol_manager_util.cc

Issue 2062013002: Fetch incremental updates. Store new state in V4Store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor: Fix DCHECK Created 4 years, 6 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: 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;

Powered by Google App Engine
This is Rietveld 408576698