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

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

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.cc
diff --git a/chrome/browser/conflicts/module_database_win.cc b/chrome/browser/conflicts/module_database_win.cc
index 399d931ef073b3a8801a0040f3b59b0910b1117f..901d3156fa7438621bdf4e13f55b5231bac73e80 100644
--- a/chrome/browser/conflicts/module_database_win.cc
+++ b/chrome/browser/conflicts/module_database_win.cc
@@ -25,7 +25,9 @@ ModuleDatabase* g_instance = nullptr;
ModuleDatabase::ModuleDatabase(
scoped_refptr<base::SequencedTaskRunner> task_runner)
- : task_runner_(std::move(task_runner)), weak_ptr_factory_(this) {}
+ : task_runner_(std::move(task_runner)),
+ module_inspector_(this),
+ weak_ptr_factory_(this) {}
ModuleDatabase::~ModuleDatabase() {
if (this == g_instance)
@@ -293,6 +295,10 @@ ModuleDatabase::ModuleInfo* ModuleDatabase::FindOrCreateModuleInfo(
modules_.size()),
std::forward_as_tuple());
+ // New modules must be inspected.
+ if (result.second)
+ module_inspector_.AddModule(result.first->first);
+
return &(*result.first);
}
@@ -321,6 +327,16 @@ void ModuleDatabase::DeleteProcessInfo(uint32_t process_id,
processes_.erase(key);
}
+void ModuleDatabase::OnModuleInspected(const ModuleInfoKey& module_key,
+ const ModuleInfoData& module_data) {
+ DCHECK(task_runner_->RunsTasksOnCurrentThread());
+
+ // Received the data. Copy it.
+ auto it = modules_.find(module_key);
+ if (it != modules_.end())
+ it->second.CopyInspectionData(module_data);
+}
+
// ModuleDatabase::ProcessInfoKey ----------------------------------------------
ModuleDatabase::ProcessInfoKey::ProcessInfoKey(

Powered by Google App Engine
This is Rietveld 408576698