1 // Copyright 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.
5 #ifndef CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_
6 #define CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_
13 #include "base/strings/string_piece.h"
19 typedef std::vector<std::pair<size_t, base::StringPiece> > AdditionalModules;
21 // Starts a background process to verify installed modules. Results are reported
23 void BeginModuleVerification();
25 // Converts a list of modules descriptions extracted from EnumerateModulesModel
26 // into a list of loaded module name digests.
27 void ExtractLoadedModuleNameDigests(
28 const base::ListValue& module_list,
29 std::set<std::string>* loaded_module_name_digests);
31 // Verifies a list of installed module name digests and inserts installed module
32 // IDs into the supplied set.
33 void VerifyModules(const std::set<std::string>& module_name_digests,
34 const AdditionalModules& additional_modules,
35 std::set<size_t>* installed_module_ids);
37 // Parses a list of additional modules to verify. The data format is a series of
38 // lines. Each line starts with a decimal ID, then a module name digest,
39 // separated by a space. Lines are terminated by \r and/or \n. The result is a
40 // vector of pairs where the first value is an ID and the second value is the
41 // corresponding module name digest. The StringPieces use the same underlying
42 // storage as |raw_data|.
44 // Invalid lines are ignored.
45 void ParseAdditionalModules(const base::StringPiece& raw_data,
46 AdditionalModules* additional_modules);
48 #endif // CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_