Chromium Code Reviews| Index: chrome/browser/conflicts/module_info_util_win.h |
| diff --git a/chrome/browser/conflicts/module_info_util_win.h b/chrome/browser/conflicts/module_info_util_win.h |
| index 9b3e51819fbcebbe5db11eac745482bcb25e669c..05dc0f6dfb248fc79699095e422d6303da4ee57f 100644 |
| --- a/chrome/browser/conflicts/module_info_util_win.h |
| +++ b/chrome/browser/conflicts/module_info_util_win.h |
| @@ -5,6 +5,9 @@ |
| #ifndef CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ |
| #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ |
| +#include <utility> |
| +#include <vector> |
| + |
| #include "base/files/file_path.h" |
| #include "base/strings/string16.h" |
| @@ -40,4 +43,21 @@ struct CertificateInfo { |
| void GetCertificateInfo(const base::FilePath& file, |
| CertificateInfo* certificate_info); |
| +// Returns a mapping of the value of an environment variable to its name. |
| +// Removes any existing trailing backslash in the values. |
| +// |
| +// e.g. c:\windows\system32\ -> %systemroot% |
| +using StringMapping = std::vector<std::pair<base::string16, base::string16>>; |
| +StringMapping GetEnvironmentVariablesMapping( |
| + const std::vector<base::string16>& environment_variables); |
| + |
| +// If |prefix_mapping| contains a matching prefix with |string|, substitutes |
| +// that prefix with its associated value. If multiple matches are found, the |
| +// longest prefix is chosen. Unmodified if no matches were found. |
| +// |
| +// This function expects |prefix_mapping| and |string| to contain lowercase |
| +// strings. |
|
chrisha
2017/03/01 15:45:43
Can you document expectations about trailing slash
Patrick Monette
2017/03/02 20:27:07
Done.
|
| +void CollapseMatchingPrefixInString(const StringMapping& prefix_mapping, |
| + base::string16* string); |
| + |
| #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_UTIL_WIN_H_ |