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/v4_local_database_manager.h

Issue 2421703002: Tiny: Post PerformFullHashCheck on IO thread, instead of calling it synchronously. (Closed)
Patch Set: Add comment about why PerformFullHashCheck is being posted Created 4 years, 2 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
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6b9a997226d87cb4ea9fa702e746cb1abe0a3e07..53ce02582e84fa26470b41fd31f70ab7eac2f9f2 100644
--- a/components/safe_browsing_db/v4_local_database_manager.h
+++ b/components/safe_browsing_db/v4_local_database_manager.h
@@ -70,6 +70,13 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
// Must be initialized by calling StartOnIOThread() before using.
V4LocalDatabaseManager(const base::FilePath& base_path);
+ ~V4LocalDatabaseManager() override;
+
+ void SetTaskRunnerForTest(
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner) {
+ task_runner_ = task_runner;
+ }
+
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.
@@ -120,10 +127,6 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
private:
friend class V4LocalDatabaseManagerTest;
- void SetTaskRunnerForTest(
- const scoped_refptr<base::SequencedTaskRunner>& task_runner) {
- task_runner_ = task_runner;
- }
FRIEND_TEST_ALL_PREFIXES(V4LocalDatabaseManagerTest,
TestGetSeverestThreatTypeAndMetadata);
@@ -131,8 +134,6 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
// which clients have cancelled their outstanding request.
typedef std::unordered_set<Client*> PendingClients;
- ~V4LocalDatabaseManager() override;
-
// Called when all the stores managed by the database have been read from
// disk after startup and the database is ready for checking resource
// reputation.
@@ -170,9 +171,9 @@ class V4LocalDatabaseManager : public SafeBrowsingDatabaseManager {
const std::vector<FullHashInfo>& full_hash_infos);
// Performs the full hash checking of the URL in |check|.
- void PerformFullHashCheck(std::unique_ptr<PendingCheck> check,
- const FullHashToStoreAndHashPrefixesMap&
- full_hash_to_store_and_hash_prefixes);
+ virtual void PerformFullHashCheck(std::unique_ptr<PendingCheck> check,
+ const FullHashToStoreAndHashPrefixesMap&
+ full_hash_to_store_and_hash_prefixes);
// When the database is ready to use, process the checks that were queued
// while the database was loading from disk.
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_local_database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698