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

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

Issue 2613803005: [win] Enable ModuleDatabase behind a flag. (Closed)
Patch Set: Rebase. 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 8172082abf73357007d32c011a7206628d2f7265..73725556ab257f8ee26874544daa6b4e5f55bf9e 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,14 @@ 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. Ownership is passed to the
+ // global instance and deliberately leaked, unless manually cleaned up. This
+ // has no locking and should be called when Chrome is single threaded.
+ 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_|.
« no previous file with comments | « chrome/browser/chrome_content_browser_manifest_overlay.json ('k') | chrome/browser/conflicts/module_database_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698