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

Unified Diff: chrome/browser/win/enumerate_modules_model.cc

Issue 2370053002: [win] Make conflict module enumeration occur at most once. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/enumerate_modules_model.cc
diff --git a/chrome/browser/win/enumerate_modules_model.cc b/chrome/browser/win/enumerate_modules_model.cc
index 958a12fc54723ca2b7fe7bc000bc2c01b63d7003..936f65b7989aadaa1d85397a932bee7260e7991f 100644
--- a/chrome/browser/win/enumerate_modules_model.cc
+++ b/chrome/browser/win/enumerate_modules_model.cc
@@ -724,10 +724,18 @@ void EnumerateModulesModel::MaybePostScanningTask() {
void EnumerateModulesModel::ScanNow() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // If a module enumerator exists then a scan is already underway.
+ // If a module enumerator exists then a scan is already underway. The client
+ // will receive a notification from that thread.
if (module_enumerator_)
return;
+ // Only allow a single scan per process lifetime. Immediately notify any
+ // observers that the scan is complete.
+ if (!enumerated_modules_.empty()) {
gab 2016/09/27 14:27:11 I'm not convinced usage of |enumerated_modules_| i
chrisha 2016/09/27 14:49:39 Greg and I had extensive discussions on the thread
gab 2016/09/27 15:11:24 Indeed, I meant the BlockingPool tasks "racing eac
chrisha 2016/09/27 15:29:07 There's some other cleanup I want to do as well (m
+ FOR_EACH_OBSERVER(Observer, observers_, OnScanCompleted());
+ return;
+ }
+
// ScanNow does not block, rather it simply schedules a task.
module_enumerator_.reset(new ModuleEnumerator(this));
module_enumerator_->ScanNow(&enumerated_modules_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698