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

Unified Diff: components/safe_browsing_db/v4_protocol_manager_util.h

Issue 2353413002: Store list information in ListInfo (was: StoreIdAndFIleName) (Closed)
Patch Set: s/StoreIdAndFileName/ListInfo. Move SBThreatType into ListInfo. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/safe_browsing_db/v4_protocol_manager_util.h
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.h b/components/safe_browsing_db/v4_protocol_manager_util.h
index 92b791253f31ad350f6835b49a4fc48500aeb76d..501488a32de60dbb206bc0d160ac49b9dcdc6846 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util.h
+++ b/components/safe_browsing_db/v4_protocol_manager_util.h
@@ -63,6 +63,43 @@ struct V4ProtocolConfig {
~V4ProtocolConfig();
};
+// Different types of threats that SafeBrowsing protects against. This is the
+// type that's returned to the clients of SafeBrowsing in Chromium.
+enum SBThreatType {
+ // No threat at all.
+ SB_THREAT_TYPE_SAFE,
+
+ // The URL is being used for phishing.
+ SB_THREAT_TYPE_URL_PHISHING,
+
+ // The URL hosts malware.
+ SB_THREAT_TYPE_URL_MALWARE,
+
+ // The URL hosts unwanted programs.
+ SB_THREAT_TYPE_URL_UNWANTED,
+
+ // The download URL is malware.
+ SB_THREAT_TYPE_BINARY_MALWARE_URL,
+
+ // Url detected by the client-side phishing model. Note that unlike the
+ // above values, this does not correspond to a downloaded list.
+ SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL,
+
+ // The Chrome extension or app (given by its ID) is malware.
+ SB_THREAT_TYPE_EXTENSION,
+
+ // Url detected by the client-side malware IP list. This IP list is part
+ // of the client side detection model.
+ SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL,
+
+ // Url leads to a blacklisted resource script. Note that no warnings should be
+ // shown on this threat type, but an incident report might be sent.
+ SB_THREAT_TYPE_BLACKLISTED_RESOURCE,
+
+ // Url abuses a permission API.
+ SB_THREAT_TYPE_API_ABUSE,
+};
+
// The information required to uniquely identify each list the client is
// interested in maintaining and downloading from the SafeBrowsing servers.
// For example, for digests of Malware binaries on Windows:
@@ -71,10 +108,7 @@ struct V4ProtocolConfig {
// threat_type = MALWARE
struct ListIdentifier {
public:
- PlatformType platform_type;
- ThreatEntryType threat_entry_type;
- ThreatType threat_type;
-
+ ListIdentifier(PlatformType, ThreatEntryType, ThreatType, SBThreatType);
ListIdentifier(PlatformType, ThreatEntryType, ThreatType);
explicit ListIdentifier(const ListUpdateResponse&);
@@ -82,7 +116,17 @@ struct ListIdentifier {
bool operator!=(const ListIdentifier& other) const;
size_t hash() const;
+ PlatformType platform_type() const { return platform_type_; }
+ ThreatEntryType threat_entry_type() const { return threat_entry_type_; }
+ ThreatType threat_type() const { return threat_type_; }
+ SBThreatType sb_threat_type() const { return sb_threat_type_; }
+
private:
+ PlatformType platform_type_;
+ ThreatEntryType threat_entry_type_;
+ ThreatType threat_type_;
+ SBThreatType sb_threat_type_;
Nathan Parker 2016/09/22 18:35:13 You don't need sb_threat_type_ here if it's in Lis
vakh (use Gerrit instead) 2016/09/22 20:33:41 Done.
+
ListIdentifier();
};

Powered by Google App Engine
This is Rietveld 408576698