summaryrefslogtreecommitdiffstats
path: root/chrome/browser/install_verification/win/install_verification.cc
blob: c113dd2f0c3f41f66faf5eaa04a3a923288f4edd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/install_verification/win/install_verification.h"

#include <set>
#include <vector>

#include "base/metrics/sparse_histogram.h"
#include "chrome/browser/install_verification/win/imported_module_verification.h"
#include "chrome/browser/install_verification/win/loaded_module_verification.h"
#include "chrome/browser/install_verification/win/module_ids.h"
#include "chrome/browser/install_verification/win/module_info.h"
#include "chrome/browser/install_verification/win/module_verification_common.h"

namespace {

void ReportModuleMatch(size_t module_id) {
  UMA_HISTOGRAM_SPARSE_SLOWLY("InstallVerifier.ModuleMatch", module_id);
}

void ReportImport(size_t module_id) {
  UMA_HISTOGRAM_SPARSE_SLOWLY("InstallVerifier.ModuleImport", module_id);
}

}  // namespace

void VerifyInstallation() {
  ModuleIDs module_ids;
  LoadModuleIDs(&module_ids);
  std::set<ModuleInfo> loaded_modules;
  if (GetLoadedModules(&loaded_modules)) {
    VerifyLoadedModules(loaded_modules, module_ids, &ReportModuleMatch);
    VerifyImportedModules(loaded_modules, module_ids, &ReportImport);
  }
}