| 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 9e3ea4fa00f545af8dd946576b08d71dbc227249..0c15432549cc066b6703b049805075360b21d269 100644
|
| --- a/components/safe_browsing_db/v4_local_database_manager.h
|
| +++ b/components/safe_browsing_db/v4_local_database_manager.h
|
| @@ -43,6 +43,7 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
|
| bool CanCheckUrl(const GURL& url) const override;
|
| bool ChecksAreAlwaysAsync() const override;
|
| bool CheckBrowseUrl(const GURL& url, Client* client) override;
|
| + AsyncMatch CheckCsdWhitelistUrl(const GURL& url, Client* client) override;
|
| bool CheckDownloadUrl(const std::vector<GURL>& url_chain,
|
| Client* client) override;
|
| // TODO(vakh): |CheckExtensionIDs| in the base class accepts a set of
|
| @@ -88,28 +89,32 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
|
| enum class ClientCallbackType {
|
| // This represents the case when we're trying to determine if a URL is
|
| // unsafe from the following perspectives: Malware, Phishing, UwS.
|
| - CHECK_BROWSE_URL = 0,
|
| + CHECK_BROWSE_URL,
|
|
|
| // This represents the case when we're trying to determine if any of the
|
| // URLs in a vector of URLs is unsafe for downloading binaries.
|
| - CHECK_DOWNLOAD_URLS = 1,
|
| + CHECK_DOWNLOAD_URLS,
|
|
|
| // This represents the case when we're trying to determine if a URL is an
|
| // unsafe resource.
|
| - CHECK_RESOURCE_URL = 2,
|
| + CHECK_RESOURCE_URL,
|
|
|
| // This represents the case when we're trying to determine if a Chrome
|
| // extension is a unsafe.
|
| - CHECK_EXTENSION_IDS = 3,
|
| + CHECK_EXTENSION_IDS,
|
|
|
| // This respresents the case when we're trying to determine if a URL belongs
|
| // to the list where subresource filter should be active.
|
| - CHECK_URL_FOR_SUBRESOURCE_FILTER = 4,
|
| + CHECK_URL_FOR_SUBRESOURCE_FILTER,
|
| +
|
| + // This respresents the case when we're trying to determine if a URL is
|
| + // part of the CSD whitelist.
|
| + CHECK_CSD_WHITELIST,
|
|
|
| // This represents the other cases when a check is being performed
|
| // synchronously so a client callback isn't required. For instance, when
|
| // trying to determing if an IP address is unsafe due to hosting Malware.
|
| - CHECK_OTHER = 5,
|
| + CHECK_OTHER,
|
| };
|
|
|
| // The information we need to process a URL safety reputation request and
|
| @@ -221,6 +226,15 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
|
| // schedules a task to perform full hash check and returns false.
|
| bool HandleCheck(std::unique_ptr<PendingCheck> check);
|
|
|
| + // Like HandleCheck, but for whitelists that have both full-hashes and
|
| + // partial hashes in the DB. Returns MATCH, NO_MATCH, or ASYNC.
|
| + AsyncMatch HandleWhitelistCheck(std::unique_ptr<PendingCheck> check);
|
| +
|
| + // Schedules a full-hash check for a given set of prefixes.
|
| + void ScheduleFullHashCheck(std::unique_ptr<PendingCheck> check,
|
| + const FullHashToStoreAndHashPrefixesMap&
|
| + full_hash_to_store_and_hash_prefixes);
|
| +
|
| // Checks |stores_to_check| in database synchronously for hash prefixes
|
| // matching |hash|. Returns true if there's a match; false otherwise. This is
|
| // used for lists that have full hash information in the database.
|
|
|