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

Unified Diff: components/safe_browsing_db/database_manager.h

Issue 2648193002: SafeBrowsing: Move enabled_ to base class DB Manager (Closed)
Patch Set: Update comments Created 3 years, 11 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 018bf15ba546c50f70aed9aead221bb112692f65..9399f78fa25fbe748fb87ae1f290136392dff9bc 100644
--- a/components/safe_browsing_db/database_manager.h
+++ b/components/safe_browsing_db/database_manager.h
@@ -196,12 +196,16 @@ class SafeBrowsingDatabaseManager
// Called to initialize objects that are used on the io_thread, such as the
// v4 protocol manager. This may be called multiple times during the life of
- // the DatabaseManager. Must be called on IO thread.
+ // the DatabaseManager. Must be called on IO thread. All subclasses should
+ // override this method, set enabled_ to true and call the base class method
+ // at the top of it.
virtual void StartOnIOThread(
net::URLRequestContextGetter* request_context_getter,
const V4ProtocolConfig& config);
- // Called to stop or shutdown operations on the io_thread.
+ // Called to stop or shutdown operations on the io_thread. All subclasses
+ // should override this method, set enabled_ to false and call the base class
+ // method at the bottom of it.
virtual void StopOnIOThread(bool shutdown);
protected:
@@ -262,6 +266,10 @@ class SafeBrowsingDatabaseManager
// responsible for deleting them when removing from the set.
ApiCheckSet api_checks_;
+ // Whether the service is running. 'enabled_' is used by the
+ // SafeBrowsingDatabaseManager on the IO thread during normal operations.
+ bool enabled_;
+
// Created and destroyed via StartOnIOThread/StopOnIOThread.
std::unique_ptr<V4GetHashProtocolManager> v4_get_hash_protocol_manager_;
« no previous file with comments | « chrome/browser/safe_browsing/local_database_manager.cc ('k') | components/safe_browsing_db/database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698