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

Side by Side Diff: chrome/browser/enumerate_modules_model_win.h

Issue 5183007: Polish the Enumerate Modules implementation a bit.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/enumerate_modules_model_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_ENUMERATE_MODULES_MODEL_WIN_H_ 5 #ifndef CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_
6 #define CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_ 6 #define CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // The name of the product the module belongs to. 74 // The name of the product the module belongs to.
75 string16 product_name; 75 string16 product_name;
76 // The module file description. 76 // The module file description.
77 string16 description; 77 string16 description;
78 // The module version. 78 // The module version.
79 string16 version; 79 string16 version;
80 // The signer of the digital certificate for the module. 80 // The signer of the digital certificate for the module.
81 string16 digital_signer; 81 string16 digital_signer;
82 // The help tips bitmask. 82 // The help tips bitmask.
83 RecommendedAction recommended_action; 83 RecommendedAction recommended_action;
84 // The duplicate count within each category of modules.
85 int duplicate_count;
84 // Whether this module has been normalized (necessary before checking it 86 // Whether this module has been normalized (necessary before checking it
85 // against blacklist). 87 // against blacklist).
86 bool normalized; 88 bool normalized;
87 }; 89 };
88 90
89 // A vector typedef of all modules enumerated. 91 // A vector typedef of all modules enumerated.
90 typedef std::vector<Module> ModulesVector; 92 typedef std::vector<Module> ModulesVector;
91 93
92 // A structure we populate with the blacklist entries. 94 // A structure we populate with the blacklist entries.
93 struct BlacklistEntry { 95 struct BlacklistEntry {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // ReportBack to let the observer know we are done. 136 // ReportBack to let the observer know we are done.
135 void ScanOnFileThread(); 137 void ScanOnFileThread();
136 138
137 // Enumerate all modules loaded into the Chrome process. 139 // Enumerate all modules loaded into the Chrome process.
138 void EnumerateLoadedModules(); 140 void EnumerateLoadedModules();
139 141
140 // Enumerate all registered Windows shell extensions. 142 // Enumerate all registered Windows shell extensions.
141 void EnumerateShellExtensions(); 143 void EnumerateShellExtensions();
142 144
143 // Enumerate all registered Winsock LSP modules. 145 // Enumerate all registered Winsock LSP modules.
144 void EnumerateWinsockModule(); 146 void EnumerateWinsockModules();
145 147
146 // Reads the registered shell extensions found under |parent| key in the 148 // Reads the registered shell extensions found under |parent| key in the
147 // registry. 149 // registry.
148 void ReadShellExtensions(HKEY parent); 150 void ReadShellExtensions(HKEY parent);
149 151
150 // Given a |module|, initializes the structure and loads additional 152 // Given a |module|, initializes the structure and loads additional
151 // information using the location field of the module. 153 // information using the location field of the module.
152 void PopulateModuleInformation(Module* module); 154 void PopulateModuleInformation(Module* module);
153 155
156 // Checks the module list to see if a |module| of the same type, location
157 // and name has been added before and if so, increments its duplication
158 // counter. If it doesn't appear in the list, it is added.
159 void AddToListWithoutDuplicating(const Module&);
160
154 // Builds up a vector of path values mapping to environment variable, 161 // Builds up a vector of path values mapping to environment variable,
155 // with pairs like [c:\windows\, %systemroot%]. This is later used to 162 // with pairs like [c:\windows\, %systemroot%]. This is later used to
156 // collapse paths like c:\windows\system32 into %systemroot%\system32, which 163 // collapse paths like c:\windows\system32 into %systemroot%\system32, which
157 // we can use for comparison against our blacklist (which uses only env vars). 164 // we can use for comparison against our blacklist (which uses only env vars).
158 // NOTE: The vector will not contain an exhaustive list of environment 165 // NOTE: The vector will not contain an exhaustive list of environment
159 // variables, only the ones currently found on the blacklist or ones that are 166 // variables, only the ones currently found on the blacklist or ones that are
160 // likely to appear there. 167 // likely to appear there.
161 void PreparePathMappings(); 168 void PreparePathMappings();
162 169
163 // For a given |module|, collapse the path from c:\windows to %systemroot%, 170 // For a given |module|, collapse the path from c:\windows to %systemroot%,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 int confirmed_bad_modules_detected_; 275 int confirmed_bad_modules_detected_;
269 276
270 // The number of suspected bad modules (not including confirmed bad ones) 277 // The number of suspected bad modules (not including confirmed bad ones)
271 // found during last scan. 278 // found during last scan.
272 int suspected_bad_modules_detected_; 279 int suspected_bad_modules_detected_;
273 280
274 DISALLOW_COPY_AND_ASSIGN(EnumerateModulesModel); 281 DISALLOW_COPY_AND_ASSIGN(EnumerateModulesModel);
275 }; 282 };
276 283
277 #endif // CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_ 284 #endif // CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/enumerate_modules_model_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698