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

Unified Diff: components/safe_browsing_db/database_manager.h

Issue 2890293004: Add the ability to check the CSD Whitelist asynchronously, for PhishGuard. (Closed)
Patch Set: Created 3 years, 7 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/database_manager.h
diff --git a/components/safe_browsing_db/database_manager.h b/components/safe_browsing_db/database_manager.h
index 01ae7caa10512703c260cdcef9ae6298f3810554..5a775623bc8f0c41a8595100083c54da23c797cd 100644
--- a/components/safe_browsing_db/database_manager.h
+++ b/components/safe_browsing_db/database_manager.h
@@ -27,6 +27,14 @@ class URLRequestContextGetter;
namespace safe_browsing {
+// Value returned by some Check*Whitelist() calls that may or may not have an
+// immediate answer.
+enum class AsyncMatch {
+ ASYNC, // No answer yet -- Client will get a callback
+ MATCH, // URL matches the list. No callback.
+ NO_MATCH, // URL doesn't match. No callback.
+};
+
struct V4ProtocolConfig;
class V4GetHashProtocolManager;
@@ -64,6 +72,9 @@ class SafeBrowsingDatabaseManager
virtual void OnCheckResourceUrlResult(const GURL& url,
SBThreatType threat_type,
const std::string& threat_hash) {}
+
+ // Called when the result of checking the CSD whitelist is known.
+ virtual void OnCheckWhitelistUrlResult(bool is_whitelisted) {}
vakh (use Gerrit instead) 2017/05/24 16:01:17 The comment is CSD specific but the method name is
Nathan Parker 2017/05/31 23:40:11 Done.
};
//
@@ -152,8 +163,15 @@ class SafeBrowsingDatabaseManager
// side phishing detection whitelist. Returns true if there was a match and
// false otherwise. To make sure we are conservative we will return true if
// an error occurs. This method must be called on the IO thread.
+ //
+ // DEPRECATED. ref: http://crbug.com/714300
virtual bool MatchCsdWhitelistUrl(const GURL& url) = 0;
+ // Check if the |url| matches any of the full-length hashes from the client-
+ // side phishing detection whitelist. The 3-state return value indicates
+ // the result or that the Client will get a callback later with the result.
+ virtual AsyncMatch CheckCsdWhitelistUrl(const GURL& url, Client* client) = 0;
vakh (use Gerrit instead) 2017/05/24 16:01:16 Please move this declaration above to keep it sort
Nathan Parker 2017/05/31 23:40:11 Done.
+
// Check if |str| matches any of the full-length hashes from the download
// whitelist. Returns true if there was a match and false otherwise. To make
// sure we are conservative we will return true if an error occurs. This

Powered by Google App Engine
This is Rietveld 408576698