OLD | NEW |
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_DATABASE_WIN_H_ | 5 #ifndef CHROME_BROWSER_CONFLICTS_MODULE_DATABASE_WIN_H_ |
6 #define CHROME_BROWSER_CONFLICTS_MODULE_DATABASE_WIN_H_ | 6 #define CHROME_BROWSER_CONFLICTS_MODULE_DATABASE_WIN_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/sequenced_task_runner.h" | 17 #include "base/sequenced_task_runner.h" |
18 #include "chrome/browser/conflicts/module_info_win.h" | 18 #include "chrome/browser/conflicts/module_info_win.h" |
19 #include "chrome/browser/conflicts/module_inspector_win.h" | 19 #include "chrome/browser/conflicts/module_inspector_win.h" |
| 20 #include "chrome/browser/conflicts/third_party_metrics_recorder_win.h" |
20 #include "content/public/common/process_type.h" | 21 #include "content/public/common/process_type.h" |
21 | 22 |
22 class ModuleDatabaseObserver; | 23 class ModuleDatabaseObserver; |
23 | 24 |
24 // A class that keeps track of all modules loaded across Chrome processes. | 25 // A class that keeps track of all modules loaded across Chrome processes. |
25 // Drives the chrome://conflicts UI. | 26 // Drives the chrome://conflicts UI. |
26 // | 27 // |
27 // This is effectively a singleton, but doesn't use base::Singleton. The intent | 28 // This is effectively a singleton, but doesn't use base::Singleton. The intent |
28 // is for the object to be created when Chrome is single-threaded, and for it | 29 // is for the object to be created when Chrome is single-threaded, and for it |
29 // be set as the process-wide singleton via SetInstance. | 30 // be set as the process-wide singleton via SetInstance. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 // Inspects new modules on a blocking task runner. | 170 // Inspects new modules on a blocking task runner. |
170 ModuleInspector module_inspector_; | 171 ModuleInspector module_inspector_; |
171 | 172 |
172 // A map of all known running processes, and modules loaded/unloaded in | 173 // A map of all known running processes, and modules loaded/unloaded in |
173 // them. | 174 // them. |
174 ProcessMap processes_; | 175 ProcessMap processes_; |
175 | 176 |
176 base::ObserverList<ModuleDatabaseObserver> observer_list_; | 177 base::ObserverList<ModuleDatabaseObserver> observer_list_; |
177 | 178 |
| 179 ThirdPartyMetricsRecorder third_party_metrics_; |
| 180 |
178 // Weak pointer factory for this object. This is used when bouncing | 181 // Weak pointer factory for this object. This is used when bouncing |
179 // incoming events to |task_runner_|. | 182 // incoming events to |task_runner_|. |
180 base::WeakPtrFactory<ModuleDatabase> weak_ptr_factory_; | 183 base::WeakPtrFactory<ModuleDatabase> weak_ptr_factory_; |
181 | 184 |
182 DISALLOW_COPY_AND_ASSIGN(ModuleDatabase); | 185 DISALLOW_COPY_AND_ASSIGN(ModuleDatabase); |
183 }; | 186 }; |
184 | 187 |
185 // Information about a running process. This ties modules in a ModuleSet to | 188 // Information about a running process. This ties modules in a ModuleSet to |
186 // processes in which they are (or have been) loaded. | 189 // processes in which they are (or have been) loaded. |
187 | 190 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // | 224 // |
222 // These are modified by the various static *LoadAddress* helper functions in | 225 // These are modified by the various static *LoadAddress* helper functions in |
223 // ModuleDatabase. The vector maintains the invariant the element with maximum | 226 // ModuleDatabase. The vector maintains the invariant the element with maximum |
224 // module ID is always last. This ensures that the usual operation of loading | 227 // module ID is always last. This ensures that the usual operation of loading |
225 // a module is O(1). | 228 // a module is O(1). |
226 ModuleLoadAddresses loaded_modules; | 229 ModuleLoadAddresses loaded_modules; |
227 ModuleLoadAddresses unloaded_modules; | 230 ModuleLoadAddresses unloaded_modules; |
228 }; | 231 }; |
229 | 232 |
230 #endif // CHROME_BROWSER_CONFLICTS_MODULE_DATABASE_WIN_H_ | 233 #endif // CHROME_BROWSER_CONFLICTS_MODULE_DATABASE_WIN_H_ |
OLD | NEW |