Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_ | |
| 6 #define CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_ | |
| 7 | |
| 8 #include <utility> | |
|
sky
2013/10/04 19:21:54
nit: sort
erikwright (departed)
2013/10/04 20:39:38
Done.
| |
| 9 #include <set> | |
| 10 #include <string> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "base/callback_forward.h" | |
| 14 #include "base/strings/string_piece.h" | |
| 15 | |
| 16 namespace base { | |
| 17 class ListValue; | |
| 18 } // namespace base | |
| 19 | |
| 20 typedef std::vector<std::pair<size_t, base::StringPiece> > AdditionalModules; | |
| 21 | |
| 22 // Starts a background process to verify installed modules. Results are reported | |
| 23 // via UMA. | |
| 24 void BeginModuleVerification(); | |
| 25 | |
| 26 // Converts a list of modules descriptions extracted from EnumerateModulesModel | |
| 27 // into a list of loaded module name digests. | |
| 28 void ExtractLoadedModuleNameDigests( | |
| 29 const base::ListValue& module_list, | |
| 30 std::set<std::string>* loaded_module_name_digests); | |
| 31 | |
| 32 // Verifies a list of installed module name digests and reports results via the | |
| 33 // supplied callback. Each reported ID corresponds to a found, expected module. | |
| 34 void VerifyModules(const std::set<std::string>& module_name_digests, | |
| 35 const AdditionalModules& additional_modules, | |
| 36 const base::Callback<void(size_t)>& delegate); | |
| 37 | |
| 38 // Parses a list of additional modules to verify. The data format is a series of | |
| 39 // lines. Each line starts with a decimal ID, then a module name digest, | |
| 40 // separated by a space. Lines are terminated by \n. The result is a vector of | |
| 41 // pairs where the first value is an ID and the second value is the | |
| 42 // corresponding module name digest. The StringPieces use the same underlying | |
| 43 // storage as |raw_data|. | |
| 44 // | |
| 45 // Invalid lines are ignored. | |
| 46 void ParseAdditionalModules(const base::StringPiece& raw_data, | |
| 47 AdditionalModules* additional_modules); | |
| 48 | |
| 49 #endif // CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_ | |
| OLD | NEW |