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

Unified Diff: chrome/browser/conflicts/module_database_win.h

Issue 2613803005: [win] Enable ModuleDatabase behind a flag. (Closed)
Patch Set: 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: chrome/browser/conflicts/module_database_win.h
diff --git a/chrome/browser/conflicts/module_database_win.h b/chrome/browser/conflicts/module_database_win.h
index 025d54f8d5433776817a54fbc27297eb7fbc48b1..46a8c346e9114de1c0599e07c9cf8b0f6b949f42 100644
--- a/chrome/browser/conflicts/module_database_win.h
+++ b/chrome/browser/conflicts/module_database_win.h
@@ -16,6 +16,10 @@
// A class that keeps track of all modules loaded across Chrome processes.
// Drives the chrome://conflicts UI.
+//
+// This is effectively a singleton, but doesn't use base::Singleton. The intent
+// is for the object to be created when Chrome is single-threaded, and for it
+// be set as the process-wide singleton via SetInstance.
class ModuleDatabase {
public:
// A ModuleDatabase is by default bound to a provided sequenced task runner.
@@ -25,6 +29,11 @@ class ModuleDatabase {
explicit ModuleDatabase(scoped_refptr<base::SequencedTaskRunner> task_runner);
~ModuleDatabase();
+ // Retrieves the singleton global instance of the ModuleDatabase.
+ static ModuleDatabase* GetInstance();
+ // Sets the global instance of the ModuleDatabase.
grt (UTC plus 2) 2017/01/06 09:44:58 nit: blank line before comment
chrisha 2017/01/10 21:01:46 Done.
+ static void SetInstance(std::unique_ptr<ModuleDatabase> module_database);
+
// Indicates that process with the given type has started. This must be called
// before any calls to OnModuleEvent or OnModuleUnload. Must be called in the
// same sequence as |task_runner_|.

Powered by Google App Engine
This is Rietveld 408576698