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

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

Issue 2368393004: Move EnumerateModulesModel work to the blocking pool. (Closed)
Patch Set: Address gab's comments. 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 | « chrome/browser/win/enumerate_modules_model.h ('k') | 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 ef0e556cdb2132e5572761c97e410005e45c05ce..958a12fc54723ca2b7fe7bc000bc2c01b63d7003 100644
--- a/chrome/browser/win/enumerate_modules_model.cc
+++ b/chrome/browser/win/enumerate_modules_model.cc
@@ -376,10 +376,13 @@ void ModuleEnumerator::ScanNow(ModulesVector* list) {
enumerated_modules_ = list;
// This object can't be reaped until it has finished scanning, so its safe
- // to post a raw pointer to another thread.
- BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- base::Bind(&ModuleEnumerator::ScanImpl,
- base::Unretained(this)));
+ // to post a raw pointer to another thread. It will simply be leaked if the
+ // scanning has not been finished before shutdown.
+ BrowserThread::GetBlockingPool()->PostWorkerTaskWithShutdownBehavior(
+ FROM_HERE,
+ base::Bind(&ModuleEnumerator::ScanImpl,
+ base::Unretained(this)),
+ base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
}
void ModuleEnumerator::ScanImpl() {
« no previous file with comments | « chrome/browser/win/enumerate_modules_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698