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. 4 5 #include "chrome/browser/install_verification/win/install_verification.h" 6 7 #include <set> 8 #include <vector> 9 10 #include "base/metrics/sparse_histogram.h" 11 #include "chrome/browser/install_verification/win/imported_module_verification.h" 12 #include "chrome/browser/install_verification/win/loaded_module_verification.h" 13 #include "chrome/browser/install_verification/win/module_ids.h" 14 #include "chrome/browser/install_verification/win/module_info.h" 15 #include "chrome/browser/install_verification/win/module_verification_common.h" 16 17 namespace { 18 19 void ReportModuleMatch(size_t module_id) { 20 UMA_HISTOGRAM_SPARSE_SLOWLY("InstallVerifier.ModuleMatch", module_id); 21 } 22 23 void ReportImport(size_t module_id) { 24 UMA_HISTOGRAM_SPARSE_SLOWLY("InstallVerifier.ModuleImport", module_id); 25 } 26 27 } // namespace 28 29 void VerifyInstallation() { 30 ModuleIDs module_ids; 31 LoadModuleIDs(&module_ids); 32 std::set<ModuleInfo> loaded_modules; 33 if (GetLoadedModules(&loaded_modules)) { 34 VerifyLoadedModules(loaded_modules, module_ids, &ReportModuleMatch); 35 VerifyImportedModules(loaded_modules, module_ids, &ReportImport); 36 } 37 } 38