| OLD | NEW |
| 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_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 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "base/timer.h" | 15 #include "base/timer.h" |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 | 18 |
| 19 class EnumerateModulesModel; | 19 class EnumerateModulesModel; |
| 20 class FilePath; | |
| 21 | 20 |
| 22 namespace base { | 21 namespace base { |
| 22 class FilePath; |
| 23 class ListValue; | 23 class ListValue; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // A helper class that implements the enumerate module functionality on the File | 26 // A helper class that implements the enumerate module functionality on the File |
| 27 // thread. | 27 // thread. |
| 28 class ModuleEnumerator : public base::RefCountedThreadSafe<ModuleEnumerator> { | 28 class ModuleEnumerator : public base::RefCountedThreadSafe<ModuleEnumerator> { |
| 29 public: | 29 public: |
| 30 // What type of module we are dealing with. Loaded modules are modules we | 30 // What type of module we are dealing with. Loaded modules are modules we |
| 31 // detect as loaded in the process at the time of scanning. The others are | 31 // detect as loaded in the process at the time of scanning. The others are |
| 32 // modules of interest and may or may not be loaded in the process at the | 32 // modules of interest and may or may not be loaded in the process at the |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Takes each module in the |enumerated_modules_| vector and matches it | 184 // Takes each module in the |enumerated_modules_| vector and matches it |
| 185 // against a fixed blacklist of bad and suspected bad modules. | 185 // against a fixed blacklist of bad and suspected bad modules. |
| 186 void MatchAgainstBlacklist(); | 186 void MatchAgainstBlacklist(); |
| 187 | 187 |
| 188 // This function executes on the UI thread when the scanning and matching | 188 // This function executes on the UI thread when the scanning and matching |
| 189 // process is done. It notifies the observer. | 189 // process is done. It notifies the observer. |
| 190 void ReportBack(); | 190 void ReportBack(); |
| 191 | 191 |
| 192 // Given a filename, returns the Subject (who signed it) retrieved from | 192 // Given a filename, returns the Subject (who signed it) retrieved from |
| 193 // the digital signature (Authenticode). | 193 // the digital signature (Authenticode). |
| 194 string16 GetSubjectNameFromDigitalSignature(const FilePath& filename); | 194 string16 GetSubjectNameFromDigitalSignature(const base::FilePath& filename); |
| 195 | 195 |
| 196 // The typedef for the vector that maps a regular file path to %env_var%. | 196 // The typedef for the vector that maps a regular file path to %env_var%. |
| 197 typedef std::vector< std::pair<string16, string16> > PathMapping; | 197 typedef std::vector< std::pair<string16, string16> > PathMapping; |
| 198 | 198 |
| 199 // The vector of paths to %env_var%, used to account for differences in | 199 // The vector of paths to %env_var%, used to account for differences in |
| 200 // where people keep there files, c:\windows vs. d:\windows, etc. | 200 // where people keep there files, c:\windows vs. d:\windows, etc. |
| 201 PathMapping path_mapping_; | 201 PathMapping path_mapping_; |
| 202 | 202 |
| 203 // The vector containing all the enumerated modules (loaded and modules of | 203 // The vector containing all the enumerated modules (loaded and modules of |
| 204 // interest). | 204 // interest). |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 int confirmed_bad_modules_detected_; | 309 int confirmed_bad_modules_detected_; |
| 310 | 310 |
| 311 // The number of suspected bad modules (not including confirmed bad ones) | 311 // The number of suspected bad modules (not including confirmed bad ones) |
| 312 // found during last scan. | 312 // found during last scan. |
| 313 int suspected_bad_modules_detected_; | 313 int suspected_bad_modules_detected_; |
| 314 | 314 |
| 315 DISALLOW_COPY_AND_ASSIGN(EnumerateModulesModel); | 315 DISALLOW_COPY_AND_ASSIGN(EnumerateModulesModel); |
| 316 }; | 316 }; |
| 317 | 317 |
| 318 #endif // CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_ | 318 #endif // CHROME_BROWSER_ENUMERATE_MODULES_MODEL_WIN_H_ |
| OLD | NEW |