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

Side by Side Diff: chrome/browser/win/enumerate_modules_model.h

Issue 2720513005: Add InspectModule() that returns a populated ModuleInspectionResult struct (Closed)
Patch Set: Another Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_WIN_ENUMERATE_MODULES_MODEL_H_ 5 #ifndef CHROME_BROWSER_WIN_ENUMERATE_MODULES_MODEL_H_
6 #define CHROME_BROWSER_WIN_ENUMERATE_MODULES_MODEL_H_ 6 #define CHROME_BROWSER_WIN_ENUMERATE_MODULES_MODEL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 // Builds up a vector of path values mapping to environment variable, 180 // Builds up a vector of path values mapping to environment variable,
181 // with pairs like [c:\windows\, %systemroot%]. This is later used to 181 // with pairs like [c:\windows\, %systemroot%]. This is later used to
182 // collapse paths like c:\windows\system32 into %systemroot%\system32, which 182 // collapse paths like c:\windows\system32 into %systemroot%\system32, which
183 // we can use for comparison against our blacklist (which uses only env vars). 183 // we can use for comparison against our blacklist (which uses only env vars).
184 // NOTE: The vector will not contain an exhaustive list of environment 184 // NOTE: The vector will not contain an exhaustive list of environment
185 // variables, only the ones currently found on the blacklist or ones that are 185 // variables, only the ones currently found on the blacklist or ones that are
186 // likely to appear there. 186 // likely to appear there.
187 void PreparePathMappings(); 187 void PreparePathMappings();
188 188
189 // For a given |module|, collapse the path from c:\windows to %systemroot%,
190 // based on the |path_mapping_| vector.
191 void CollapsePath(Module* module);
192
193 // Reports (via UMA) a handful of high-level metrics regarding third party 189 // Reports (via UMA) a handful of high-level metrics regarding third party
194 // modules in this process. Called by ScanImplFinish. 190 // modules in this process. Called by ScanImplFinish.
195 void ReportThirdPartyMetrics(); 191 void ReportThirdPartyMetrics();
196 192
197 // The typedef for the vector that maps a regular file path to %env_var%.
198 typedef std::vector<std::pair<base::string16, base::string16>> PathMapping;
199
200 // The TaskRunner to perform work in the background. 193 // The TaskRunner to perform work in the background.
201 const scoped_refptr<base::TaskRunner> background_task_runner_; 194 const scoped_refptr<base::TaskRunner> background_task_runner_;
202 195
203 // The vector of paths to %env_var%, used to account for differences in 196 // The vector of paths to %env_var%, used to account for differences in
204 // where people keep there files, c:\windows vs. d:\windows, etc. 197 // where people keep there files, c:\windows vs. d:\windows, etc.
205 PathMapping path_mapping_; 198 StringMapping path_mapping_;
206 199
207 // The vector containing all the enumerated modules (loaded and modules of 200 // The vector containing all the enumerated modules (loaded and modules of
208 // interest). 201 // interest).
209 ModulesVector* enumerated_modules_; 202 ModulesVector* enumerated_modules_;
210 203
211 // The observer, which needs to be notified when the scan is complete. 204 // The observer, which needs to be notified when the scan is complete.
212 EnumerateModulesModel* observer_; 205 EnumerateModulesModel* observer_;
213 206
214 // The delay that is observed between module inspection tasks. This is 207 // The delay that is observed between module inspection tasks. This is
215 // currently 1 second, which means it takes several minutes to iterate over 208 // currently 1 second, which means it takes several minutes to iterate over
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // The number of suspected bad modules (not including confirmed bad ones) 347 // The number of suspected bad modules (not including confirmed bad ones)
355 // found during last scan. Only modified on the UI thread. 348 // found during last scan. Only modified on the UI thread.
356 int suspected_bad_modules_detected_; 349 int suspected_bad_modules_detected_;
357 350
358 base::ObserverList<Observer> observers_; 351 base::ObserverList<Observer> observers_;
359 352
360 DISALLOW_COPY_AND_ASSIGN(EnumerateModulesModel); 353 DISALLOW_COPY_AND_ASSIGN(EnumerateModulesModel);
361 }; 354 };
362 355
363 #endif // CHROME_BROWSER_WIN_ENUMERATE_MODULES_MODEL_H_ 356 #endif // CHROME_BROWSER_WIN_ENUMERATE_MODULES_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/conflicts/module_info_win_unittest.cc ('k') | chrome/browser/win/enumerate_modules_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698