Commit 3537c21e authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Fix UtilWin service process spam

This prevents the ModuleInspector service process connection from being
too aggressively torn down, allowing for reuse of the same service
process over multiple module inspection operations.

Bug: 990205
Change-Id: I7c0b083141ff058b6045acf3c8d299e54f11e0bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1734172
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarPatrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684077}
parent b47f59bf
...@@ -171,7 +171,7 @@ void ModuleInspector::SetModuleInspectionResultForTesting( ...@@ -171,7 +171,7 @@ void ModuleInspector::SetModuleInspectionResultForTesting(
void ModuleInspector::EnsureUtilWinServiceBound() { void ModuleInspector::EnsureUtilWinServiceBound() {
DCHECK(base::FeatureList::IsEnabled(kWinOOPInspectModuleFeature)); DCHECK(base::FeatureList::IsEnabled(kWinOOPInspectModuleFeature));
if (test_remote_util_win_) if (test_remote_util_win_ || remote_util_win_)
return; return;
remote_util_win_ = LaunchUtilWinServiceInstance(); remote_util_win_ = LaunchUtilWinServiceInstance();
...@@ -313,13 +313,6 @@ void ModuleInspector::OnInspectionFinished( ...@@ -313,13 +313,6 @@ void ModuleInspector::OnInspectionFinished(
on_module_inspected_callback_.Run(module_key, std::move(inspection_result)); on_module_inspected_callback_.Run(module_key, std::move(inspection_result));
// Disconnect from the UtilWin service to clean up the service process. While
// this code is only ever needed in the case the WinOOPInspectModule feature
// is enabled, it's faster to check the Remote's bound state than to check the
// feature status.
if (queue_.empty() && remote_util_win_)
remote_util_win_.reset();
// Continue the work. // Continue the work.
if (!queue_.empty()) if (!queue_.empty())
StartInspectingModule(); StartInspectingModule();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment