Chromium Code Reviews| Index: components/nacl/renderer/plugin/pnacl_resources.h |
| diff --git a/components/nacl/renderer/plugin/pnacl_resources.h b/components/nacl/renderer/plugin/pnacl_resources.h |
| index 0ec78ea0ec0f09a695bb20aaa8bfc695098e240e..9e67cab948e6433e47933d1a36f536e94e479c65 100644 |
| --- a/components/nacl/renderer/plugin/pnacl_resources.h |
| +++ b/components/nacl/renderer/plugin/pnacl_resources.h |
| @@ -5,10 +5,6 @@ |
| #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_RESOURCES_H_ |
| #define COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_RESOURCES_H_ |
| -#include <map> |
| -#include <vector> |
| - |
| -#include "components/nacl/renderer/plugin/plugin_error.h" |
| #include "components/nacl/renderer/ppb_nacl_private.h" |
| #include "native_client/src/include/nacl_macros.h" |
| #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| @@ -18,12 +14,23 @@ namespace plugin { |
| class Plugin; |
| +// PNaCl tool files / resources, which are opened by the browser. |
| +struct PnaclResourceEntries { |
| + // The name of the tool that corresponds to the opened file. |
| + std::string tool_name; |
| + |
| + // File info for the executables, after they've been opened. |
| + // Only valid after StartLoad() has been called, and until |
| + // TakeFileInfo(ResourceType) is called. |
| + PP_NaClFileInfo file_info; |
| +}; |
| + |
| // Loads a list of resources, providing a way to get file descriptors for |
| // these resources. URLs for resources are resolved by the manifest |
| -// and point to pnacl component filesystem resources. |
| +// and point to PNaCl component filesystem resources. |
| class PnaclResources { |
| public: |
| - explicit PnaclResources(Plugin* plugin); |
| + PnaclResources(Plugin* plugin, bool use_subzero); |
| virtual ~PnaclResources(); |
| // Read the resource info JSON file. This is the first step after |
| @@ -33,27 +40,24 @@ class PnaclResources { |
| // Start loading the resources. |
| bool StartLoad(); |
| - const std::string& GetLlcUrl() { return llc_tool_name_; } |
| - const std::string& GetLdUrl() { return ld_tool_name_; } |
| + enum ResourceType { kLLC, kLD, kSubzero, kNumTypes }; |
|
Derek Schuff
2015/03/30 16:39:47
it looks like chromium style is all-caps for enums
jvoung (off chromium)
2015/03/30 20:26:40
DONE
|
| + |
| + const std::string& GetUrl(ResourceType type) const; |
| - PP_NaClFileInfo TakeLlcFileInfo(); |
| - PP_NaClFileInfo TakeLdFileInfo(); |
| + PP_NaClFileInfo TakeFileInfo(ResourceType type); |
| private: |
| NACL_DISALLOW_COPY_AND_ASSIGN(PnaclResources); |
| // The plugin requesting the resource loading. |
| Plugin* plugin_; |
| + bool use_subzero_; |
| - // Tool names for llc and ld; read from the resource info file. |
| - std::string llc_tool_name_; |
| - std::string ld_tool_name_; |
| + PnaclResourceEntries resources_[kNumTypes + 1]; |
|
Derek Schuff
2015/03/30 16:39:47
you could make this a std::vector, which would sim
jvoung (off chromium)
2015/03/30 20:26:40
I think plain arrays also support range-for, but c
|
| - // File info for llc and ld executables, after they've been opened. |
| - // Only valid after the callback for StartLoad() has been called, and until |
| - // TakeLlcFileInfo()/TakeLdFileInfo() is called. |
| PP_NaClFileInfo llc_file_info_; |
| PP_NaClFileInfo ld_file_info_; |
| + PP_NaClFileInfo subzero_file_info_; |
| }; |
| } // namespace plugin |