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

Unified Diff: components/safe_browsing_db/v4_local_database_manager.h

Issue 2495783003: Implement support for checking bad IPs aka MatchMalwareIP (Closed)
Patch Set: shess@ review and trying to fix Windows build error Created 4 years, 1 month 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_local_database_manager.h
diff --git a/components/safe_browsing_db/v4_local_database_manager.h b/components/safe_browsing_db/v4_local_database_manager.h
index 297fdf058a9a9c51d11980a68e2003049cd057e9..292dbd0e7192696ed63742e4289a1c5dd2d4c564 100644
--- a/components/safe_browsing_db/v4_local_database_manager.h
+++ b/components/safe_browsing_db/v4_local_database_manager.h
@@ -95,9 +95,13 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
// unsafe resource.
CHECK_RESOURCE_URL = 2,
- // This represents the case where we're trying to determine if a Chrome
+ // This represents the case when we're trying to determine if a Chrome
// extension is a unsafe.
- CHECK_EXTENSION_IDS = 3
+ CHECK_EXTENSION_IDS = 3,
+
+ // This represents the case when we're trying to determing if an IP address
+ // is unsafe due to hosting Malware.
+ CHECK_MALWARE_IP = 4
};
// The information we need to process a URL safety reputation request and
@@ -194,8 +198,15 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
// Queues the check for async response if the database isn't ready yet.
// If the database is ready, checks the database for prefix matches and
// returns true immediately if there's no match. If a match is found, it
- // schedules a task to perform full hash check and returns false.
- bool HandleCheck(std::unique_ptr<PendingCheck> check);
+ // schedules a task to perform full hash check and returns false. If
+ // |synchronous_response| is false, an asynchronous full hash request to
+ // fetch full hashes for the matching hash prefixes is sent to the
+ // SafeBrowsing service.
+ bool HandleCheck(std::unique_ptr<PendingCheck> check,
+ const bool synchronous_response = false);
Nathan Parker 2016/11/14 21:09:37 I think this arg is confusing... I've commented in
vakh (use Gerrit instead) 2016/11/15 00:36:21 Done.
+
+ static bool IPAddressToEncodedIPV6(const std::string& ip_address,
+ std::string* encoded_ip);
// Called when the |v4_get_hash_protocol_manager_| has the full hash response
// available for the URL that we requested. It determines the severest

Powered by Google App Engine
This is Rietveld 408576698