Chromium Code Reviews| 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_); |