| Index: chrome/browser/conflicts/module_inspector_win.cc
|
| diff --git a/chrome/browser/conflicts/module_inspector_win.cc b/chrome/browser/conflicts/module_inspector_win.cc
|
| index e706b06ea2ab9c14a318544e469051a463ede8b6..a17b640e7280b8d30cef907456d39bfc3d0f25bc 100644
|
| --- a/chrome/browser/conflicts/module_inspector_win.cc
|
| +++ b/chrome/browser/conflicts/module_inspector_win.cc
|
| @@ -18,13 +18,22 @@ StringMapping GetPathMapping() {
|
| });
|
| }
|
|
|
| +// Wrapper function for InspectModule() that takes the StringMapping via a
|
| +// scoped_refptr. This saves a copy per invocation.
|
| +std::unique_ptr<ModuleInspectionResult> InspectModuleOnBlockingSequence(
|
| + scoped_refptr<base::RefCountedData<StringMapping>> env_variable_mapping,
|
| + const ModuleInfoKey& module_key) {
|
| + return InspectModule(env_variable_mapping->data, module_key);
|
| +}
|
| +
|
| } // namespace
|
|
|
| ModuleInspector::ModuleInspector(
|
| const OnModuleInspectedCallback& on_module_inspected_callback)
|
| : on_module_inspected_callback_(on_module_inspected_callback),
|
| inspection_task_priority_(base::TaskPriority::BACKGROUND),
|
| - path_mapping_(GetPathMapping()),
|
| + path_mapping_(base::MakeRefCounted<base::RefCountedData<StringMapping>>(
|
| + GetPathMapping())),
|
| weak_ptr_factory_(this) {}
|
|
|
| ModuleInspector::~ModuleInspector() = default;
|
| @@ -50,7 +59,8 @@ void ModuleInspector::StartInspectingModule() {
|
| FROM_HERE,
|
| {base::MayBlock(), inspection_task_priority_,
|
| base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
|
| - base::BindOnce(&InspectModule, path_mapping_, module_key),
|
| + base::BindOnce(&InspectModuleOnBlockingSequence, path_mapping_,
|
| + module_key),
|
| base::BindOnce(&ModuleInspector::OnInspectionFinished,
|
| weak_ptr_factory_.GetWeakPtr(), module_key));
|
| }
|
|
|