Home | History | Annotate | Download | only in win
      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/loaded_module_verification.h"
      6 
      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"
     12 
     13 namespace {
     14 
     15 std::string ExtractModuleNameDigest(const ModuleInfo& module_info) {
     16   return CalculateModuleNameDigest(module_info.name);
     17 }
     18 
     19 }  // namespace
     20 
     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);
     30 }
     31