Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / install_verification / win / loaded_module_verification.cc
blobda6253a680ba36e614e9430b0b992c2b013a9ec3
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.
5 #include "chrome/browser/install_verification/win/loaded_module_verification.h"
7 #include <algorithm>
8 #include <iterator>
9 #include <string>
10 #include "chrome/browser/install_verification/win/module_ids.h"
11 #include "chrome/browser/install_verification/win/module_info.h"
13 namespace {
15 std::string ExtractModuleNameDigest(const ModuleInfo& module_info) {
16 return CalculateModuleNameDigest(module_info.name);
19 } // namespace
21 void VerifyLoadedModules(const std::set<ModuleInfo>& loaded_modules,
22 const ModuleIDs& module_ids,
23 ModuleVerificationDelegate* delegate) {
24 std::vector<std::string> module_name_digests;
25 std::transform(loaded_modules.begin(),
26 loaded_modules.end(),
27 std::back_inserter(module_name_digests),
28 &ExtractModuleNameDigest);
29 ReportModuleMatches(module_name_digests, module_ids, delegate);