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

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

Issue 2721503003: Add ModuleInspector (Closed)
Patch Set: Created 3 years, 10 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 ef7f4e3348cc72e5faef64b53e411b20472fdde3..26f9e035232e1284b30ca7833d1b58a0c753e53e 100644
--- a/chrome/browser/conflicts/module_database_win.h
+++ b/chrome/browser/conflicts/module_database_win.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "chrome/browser/conflicts/module_info_win.h"
+#include "chrome/browser/conflicts/module_inspector_win.h"
#include "content/public/common/process_type.h"
// A class that keeps track of all modules loaded across Chrome processes.
@@ -23,7 +24,7 @@
// 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 {
+class ModuleDatabase : public ModuleInspector::Delegate {
chrisha 2017/03/01 16:03:38 Is delegate the right pattern here? A delegate doe
Patrick Monette 2017/03/03 22:16:29 Using a callback sgtm. Done.
public:
// Structures for maintaining information about modules.
using ModuleMap = std::map<ModuleInfoKey, ModuleInfoData>;
@@ -142,12 +143,19 @@ class ModuleDatabase {
// Deletes a process info entry.
void DeleteProcessInfo(uint32_t process_id, uint64_t creation_time);
+ // ModuleInspector::Delegate:
+ void OnModuleInspected(const ModuleInfoKey& module_key,
+ const ModuleInfoData& module_data) override;
+
// The task runner to which this object is bound.
scoped_refptr<base::SequencedTaskRunner> task_runner_;
// A map of all known modules.
ModuleMap modules_;
+ // Inspects new modules on a blocking task runner.
+ ModuleInspector module_inspector_;
+
// A map of all known running processes, and modules loaded/unloaded in
// them.
ProcessMap processes_;

Powered by Google App Engine
This is Rietveld 408576698