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

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: Nits: Added some comments in BUILD.gn. Using #else for platform_type until I resolve the android bu… 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..225835129a284df3d8b9d44b0e627e49683c98ee 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util.cc
+++ b/components/safe_browsing_db/v4_protocol_manager_util.cc
@@ -19,6 +19,13 @@ namespace safe_browsing {
// The Safe Browsing V4 server URL prefix.
const char kSbV4UrlPrefix[] = "https://safebrowsing.googleapis.com/v4";
+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;
+}
Scott Hess - ex-Googler 2016/06/17 22:53:43 I'm not sure how this integrates with the overall
vakh (use Gerrit instead) 2016/06/20 22:28:43 You mean just empty {}? It's not clear to me how t
Scott Hess - ex-Googler 2016/06/21 21:03:44 I mean that whoever is invoking this might be code
vakh (use Gerrit instead) 2016/06/21 23:19:35 Done.
Scott Hess - ex-Googler 2016/06/24 23:01:19 I'll grant that there may not be _much_ harm in ke
vakh (use Gerrit instead) 2016/06/27 19:38:27 It is being used in a valid case: if we get an upd
Scott Hess - ex-Googler 2016/06/27 22:19:17 Sigh, "bee in my bonnet". Basically "Why does Sco
vakh (use Gerrit instead) 2016/06/27 23:58:52 Acknowledged.
+
bool UpdateListIdentifier::operator==(const UpdateListIdentifier& other) const {
return platform_type == other.platform_type &&
threat_entry_type == other.threat_entry_type &&
@@ -38,6 +45,20 @@ size_t UpdateListIdentifier::hash() const {
return base::HashInts(interim, third);
}
+UpdateListIdentifier::UpdateListIdentifier() {}
Scott Hess - ex-Googler 2016/06/17 22:53:43 Is the bare version ever used? If so, will everyt
vakh (use Gerrit instead) 2016/06/20 22:28:43 Done.
+
+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) {}
+
+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