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

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

Issue 2720513005: Add InspectModule() that returns a populated ModuleInspectionResult struct (Closed)
Patch Set: a 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_WIN_H_ 5 #ifndef CHROME_BROWSER_CONFLICTS_MODULE_INFO_WIN_H_
6 #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_WIN_H_ 6 #define CHROME_BROWSER_CONFLICTS_MODULE_INFO_WIN_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/browser/conflicts/module_info_util_win.h" 9 #include "chrome/browser/conflicts/module_info_util_win.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 }; 44 };
45 45
46 // Holds more detailed information about a given module. Because most of this 46 // Holds more detailed information about a given module. Because most of this
47 // information is expensive to gather and require disk access, it should be 47 // information is expensive to gather and require disk access, it should be
48 // collected on a task runner that allow blocking. 48 // collected on a task runner that allow blocking.
49 struct ModuleInfoData { 49 struct ModuleInfoData {
50 ModuleInfoData(); 50 ModuleInfoData();
51 ModuleInfoData(const ModuleInfoData& others); 51 ModuleInfoData(const ModuleInfoData& others);
52 ~ModuleInfoData(); 52 ~ModuleInfoData();
53 53
54 // Used to copy a ModuleInfoData returned by InspectModule() into an empty,
55 // existing one.
56 void CopyInspectionData(const ModuleInfoData& other);
chrisha 2017/02/28 18:51:29 How about just a plain old operator=? Or pass a Mo
Patrick Monette 2017/02/28 23:37:38 I definitely don't like my current approach. Let m
chrisha 2017/03/01 15:45:42 Yeah, having a separate section of ModuleInspectio
Patrick Monette 2017/03/02 20:27:07 Done.
57
54 // Set of all process types in which this module has been seen (may not be 58 // Set of all process types in which this module has been seen (may not be
55 // currently present in a process of that type). This is a conversion of 59 // currently present in a process of that type). This is a conversion of
56 // ProcessType enumeration to a bitfield. See "ProcessTypeToBit" and 60 // ProcessType enumeration to a bitfield. See "ProcessTypeToBit" and
57 // "BitIndexToProcessType" for details. 61 // "BitIndexToProcessType" for details.
58 uint32_t process_types; 62 uint32_t process_types;
59 63
60 // The following pieces of information are determined via a detailed 64 // The following pieces of information are determined via a detailed
61 // inspection of the module. 65 // inspection of the module.
62 66
67 // Indicates if the module has been inspected.
68 bool inspected;
69
63 // The module path, not including the basename. This is cleaned and normalized 70 // The module path, not including the basename. This is cleaned and normalized
64 // so that common paths are converted to their environment variable mappings 71 // so that common paths are converted to their environment variable mappings
65 // (ie, %systemroot%). This makes i18n localized paths easily comparable. 72 // (ie, %systemroot%). This makes i18n localized paths easily comparable.
66 base::string16 location; 73 base::string16 location;
67 74
68 // The basename of the module. 75 // The basename of the module.
69 base::string16 basename; 76 base::string16 basename;
70 77
71 // The name of the product the module belongs to. 78 // The name of the product the module belongs to.
72 base::string16 product_name; 79 base::string16 product_name;
73 80
74 // The module file description. 81 // The module file description.
75 base::string16 description; 82 base::string16 description;
76 83
77 // The module version. This is usually in the form a.b.c.d (where a, b, c and 84 // The module version. This is usually in the form a.b.c.d (where a, b, c and
78 // d are integers), but may also have fewer than 4 components. 85 // d are integers), but may also have fewer than 4 components.
79 base::string16 version; 86 base::string16 version;
80 87
81 // The certificate info for the module. 88 // The certificate info for the module.
82 CertificateInfo certificate_info; 89 CertificateInfo certificate_info;
83 }; 90 };
84 91
92 // Given a module identified by |module_key|, returns a populated ModuleInfoData
93 // that contains detailed information about the module on disk. This is a
94 // blocking task that requires access to disk.
95 ModuleInfoData InspectModule(const StringMapping& env_variable_mapping,
96 const ModuleInfoKey& module_key);
97
85 #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_WIN_H_ 98 #endif // CHROME_BROWSER_CONFLICTS_MODULE_INFO_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698