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

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

Issue 2670763007: Use TaskScheduler instead of blocking pool in enumerate_modules_model.cc. (Closed)
Patch Set: CR and fix build error" Created 3 years, 10 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 | chrome/browser/win/enumerate_modules_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/enumerate_modules_model.h
diff --git a/chrome/browser/win/enumerate_modules_model.h b/chrome/browser/win/enumerate_modules_model.h
index 76ce0227904495040d4d729af10fdd2417c4a148..7eb192f23ac45272477b0582ec2f7a2a4dab56d0 100644
--- a/chrome/browser/win/enumerate_modules_model.h
+++ b/chrome/browser/win/enumerate_modules_model.h
@@ -141,18 +141,11 @@ class ModuleEnumerator {
private:
FRIEND_TEST_ALL_PREFIXES(EnumerateModulesTest, CollapsePath);
- // This function enumerates all modules in the blocking pool. Once the list of
- // module filenames is populated it posts a delayed task to call
- // ScanImplDelay for the first module.
+ // This function posts a task to enumerate all modules asynchronously. Once
+ // the list of module filenames is populated, a delayed task is posted to scan
+ // the first module.
void ScanImplStart();
- // Immediately posts a CONTINUE_ON_SHUTDOWN task to ScanImplModule for the
- // given module. This ping-ponging is because the blocking pool does not
- // offer a delayed CONTINUE_ON_SHUTDOWN task.
- // TODO(chrisha): When the new scheduler enables delayed CONTINUE_ON_SHUTDOWN
- // tasks, simplify this logic.
- void ScanImplDelay(size_t index);
-
// Inspects the module in |enumerated_modules_| at the given |index|. Gets
// module information, normalizes it, and collapses the path. This is an
// expensive operation and non-critical. Posts a delayed task to ScanImplDelay
@@ -210,6 +203,9 @@ class ModuleEnumerator {
// The typedef for the vector that maps a regular file path to %env_var%.
typedef std::vector<std::pair<base::string16, base::string16>> PathMapping;
+ // The TaskRunner to perform work in the background.
+ const scoped_refptr<base::TaskRunner> background_task_runner_;
+
// The vector of paths to %env_var%, used to account for differences in
// where people keep there files, c:\windows vs. d:\windows, etc.
PathMapping path_mapping_;
@@ -248,7 +244,7 @@ class ModuleEnumerator {
// ready.
//
// The member functions of this class may only be used from the UI thread. The
-// bulk of the work is actually performed in the blocking pool with
+// bulk of the work is actually performed asynchronously in TaskScheduler with
// CONTINUE_ON_SHUTDOWN semantics, as the WinCrypt functions can effectively
// block arbitrarily during shutdown.
//
@@ -341,13 +337,12 @@ class EnumerateModulesModel {
void DoneScanning();
// The vector containing all the modules enumerated. Will be normalized and
- // any bad modules will be marked. Written to from the blocking pool by the
- // |module_enumerator_|, read from on the UI thread by this class.
+ // any bad modules will be marked. Written to from the background TaskRunner
+ // by the |module_enumerator_|, read from on the UI thread by this class.
ModuleEnumerator::ModulesVector enumerated_modules_;
- // The object responsible for enumerating the modules in the blocking pool.
- // Only used from the UI thread. This ends up internally doing its work in the
- // blocking pool.
+ // The object responsible for enumerating the modules on a background
+ // TaskRunner. Only accessed from the UI thread.
std::unique_ptr<ModuleEnumerator> module_enumerator_;
// Whether the conflict notification has been acknowledged by the user. Only
« no previous file with comments | « no previous file | chrome/browser/win/enumerate_modules_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698