Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: src/untrusted/pll_loader/pll_loader.h

Issue 1832623002: PNaCl Dynamic Linking: Using unordered_set to disallow duplicate modules. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Code review Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/untrusted/pll_loader/pll_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/pll_loader/pll_loader.h
diff --git a/src/untrusted/pll_loader/pll_loader.h b/src/untrusted/pll_loader/pll_loader.h
index 65577f51f7388f2abc3cc83f42b233139f181836..0cdecc352c313e24ef0485a12773d155cc6a6ce3 100644
--- a/src/untrusted/pll_loader/pll_loader.h
+++ b/src/untrusted/pll_loader/pll_loader.h
@@ -5,6 +5,8 @@
#ifndef NATIVE_CLIENT_SRC_UNTRUSTED_PLL_LOADER_PLL_LOADER_H_
#define NATIVE_CLIENT_SRC_UNTRUSTED_PLL_LOADER_PLL_LOADER_H_ 1
+#include <string>
+#include <unordered_set>
#include <vector>
#include "native_client/src/untrusted/pll_loader/pll_root.h"
@@ -42,9 +44,16 @@ class PLLModule {
// ModuleSet represents a set of loaded PLLs.
class ModuleSet {
public:
- // Load a PLL and add it to the set.
+ // Load a PLL by filename. Does not add the filename to a known set of loaded
+ // modules, and will not de-duplicate loading modules.
void AddByFilename(const char *filename);
+ // Change the search path used by the linker when looking for PLLs by soname.
+ void SetSonameSearchPath(const std::vector<std::string> &dir_list);
+
+ // Load a PLL by soname and add the soname to the set of loaded modules.
+ void AddBySoname(const char *soname);
+
// Looks up a symbol in the set of modules. This does a linear search of
// the modules, in the order that they were added using AddByFilename().
void *GetSym(const char *name);
@@ -53,6 +62,10 @@ class ModuleSet {
void ResolveRefs();
private:
+ // The search path used to look for "sonames".
+ std::vector<std::string> search_path_;
+ // An unordered set of "sonames" (to see if a module has been loaded).
+ std::unordered_set<std::string> sonames_;
std::vector<PLLModule> modules_;
};
« no previous file with comments | « no previous file | src/untrusted/pll_loader/pll_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698