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

Side by Side Diff: chrome/browser/conflicts/module_info_util_win.h

Issue 2720513005: Add InspectModule() that returns a populated ModuleInspectionResult struct (Closed)
Patch Set: Addressing comments 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ 5 #ifndef CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_
6 #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ 6 #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_
7 7
8 #include <utility>
9 #include <vector>
10
8 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
9 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
10 13
11 // The type of certificate found for the module. 14 // The type of certificate found for the module.
12 enum class CertificateType { 15 enum class CertificateType {
13 // The module is not signed. 16 // The module is not signed.
14 NO_CERTIFICATE, 17 NO_CERTIFICATE,
15 // The module is signed and the certificate is in the module. 18 // The module is signed and the certificate is in the module.
16 CERTIFICATE_IN_FILE, 19 CERTIFICATE_IN_FILE,
17 // The module is signed and the certificate is in an external catalog. 20 // The module is signed and the certificate is in an external catalog.
(...skipping 15 matching lines...) Expand all
33 // "Google Inc." or "Microsoft Inc."). 36 // "Google Inc." or "Microsoft Inc.").
34 base::string16 subject; 37 base::string16 subject;
35 }; 38 };
36 39
37 // Extracts information about the certificate of the given |file|, populating 40 // Extracts information about the certificate of the given |file|, populating
38 // |certificate_info|. It is expected that |certificate_info| be freshly 41 // |certificate_info|. It is expected that |certificate_info| be freshly
39 // constructed. 42 // constructed.
40 void GetCertificateInfo(const base::FilePath& file, 43 void GetCertificateInfo(const base::FilePath& file,
41 CertificateInfo* certificate_info); 44 CertificateInfo* certificate_info);
42 45
46 // Returns a mapping of the value of an environment variable to its name.
47 // Removes any existing trailing backslash in the values.
48 //
49 // e.g. c:\windows\system32 -> %systemroot%
50 using StringMapping = std::vector<std::pair<base::string16, base::string16>>;
51 StringMapping GetEnvironmentVariablesMapping(
52 const std::vector<base::string16>& environment_variables);
53
54 // If |prefix_mapping| contains a matching prefix with |path|, substitutes that
55 // prefix with its associated value. If multiple matches are found, the longest
56 // prefix is chosen. Unmodified if no matches are found.
57 //
58 // This function expects |prefix_mapping| and |path| to contain lowercase
59 // strings. Also, |prefix_mapping| must not contain any trailling backslashes.
chrisha 2017/03/04 15:54:16 trailing*
Patrick Monette 2017/03/06 16:39:47 Done.
60 void CollapseMatchingPrefixInPath(const StringMapping& prefix_mapping,
61 base::string16* path);
62
43 #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ 63 #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/conflicts/module_info_util_win.cc » ('j') | chrome/browser/conflicts/module_info_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698