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 #ifndef CHROME_BROWSER_INSTALL_VERIFICATION_WIN_MODULE_LIST_H_
6 #define CHROME_BROWSER_INSTALL_VERIFICATION_WIN_MODULE_LIST_H_
13 #include "base/basictypes.h"
14 #include "base/memory/scoped_ptr.h"
18 // Manages a list of HMODULEs, releasing them upon destruction.
23 // Attempts to AddRef each HMODULE in |snapshot|. If a module was unloaded
24 // since |snapshot| was taken it will be silently dropped. Successfully
25 // AddRef'd HMODULEs will be inserted in the returned ModuleList.
27 // This method _always_ returns a valid ModuleList instance.
28 static scoped_ptr
<ModuleList
> FromLoadedModuleSnapshot(
29 const std::vector
<HMODULE
>& snapshot
);
31 // Retrieves name and address information for the module list.
32 void GetModuleInfoSet(std::set
<ModuleInfo
>* module_info_set
);
35 return modules_
.size();
38 HMODULE
operator[](size_t index
) const {
39 return modules_
[index
];
45 std::vector
<HMODULE
> modules_
;
47 DISALLOW_COPY_AND_ASSIGN(ModuleList
);
50 #endif // CHROME_BROWSER_INSTALL_VERIFICATION_WIN_MODULE_LIST_H_