| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
| 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return ld_tool_name; | 72 return ld_tool_name; |
| 73 } | 73 } |
| 74 | 74 |
| 75 nacl::string GetFullUrl(const nacl::string& partial_url, | 75 nacl::string GetFullUrl(const nacl::string& partial_url, |
| 76 const nacl::string& sandbox_arch) const; | 76 const nacl::string& sandbox_arch) const; |
| 77 | 77 |
| 78 // Get file descs by name. Only valid after StartLoad's completion callback | 78 // Get file descs by name. Only valid after StartLoad's completion callback |
| 79 // fired. | 79 // fired. |
| 80 nacl::DescWrapper* WrapperForUrl(const nacl::string& url); | 80 nacl::DescWrapper* WrapperForUrl(const nacl::string& url); |
| 81 | 81 |
| 82 static int32_t GetPnaclFD(Plugin* plugin, const char* filename); | 82 static int32_t GetPnaclFD(Plugin* plugin, |
| 83 const char* filename, |
| 84 bool is_executable, |
| 85 uint64_t* file_token_lo, |
| 86 uint64_t* file_token_hi); |
| 83 | 87 |
| 84 private: | 88 private: |
| 85 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclResources); | 89 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclResources); |
| 86 | 90 |
| 87 // The plugin requesting the resource loading. | 91 // The plugin requesting the resource loading. |
| 88 Plugin* plugin_; | 92 Plugin* plugin_; |
| 89 // The coordinator responsible for reporting errors, etc. | 93 // The coordinator responsible for reporting errors, etc. |
| 90 PnaclCoordinator* coordinator_; | 94 PnaclCoordinator* coordinator_; |
| 91 // The descriptor wrappers for the downloaded URLs. Only valid | 95 // The descriptor wrappers for the downloaded URLs. Only valid |
| 92 // once all_loaded_callback_ has been invoked. | 96 // once all_loaded_callback_ has been invoked. |
| 93 std::map<nacl::string, nacl::DescWrapper*> resource_wrappers_; | 97 std::map<nacl::string, nacl::DescWrapper*> resource_wrappers_; |
| 94 | 98 |
| 95 // Tool names for llc and ld; read from the resource info file. | 99 // Tool names for llc and ld; read from the resource info file. |
| 96 nacl::string llc_tool_name; | 100 nacl::string llc_tool_name; |
| 97 nacl::string ld_tool_name; | 101 nacl::string ld_tool_name; |
| 98 | 102 |
| 99 // Parses resource info json data in |buf|. Returns true if successful. | 103 // Parses resource info json data in |buf|. Returns true if successful. |
| 100 // Otherwise returns false and places an error message in |errmsg|. | 104 // Otherwise returns false and places an error message in |errmsg|. |
| 101 bool ParseResourceInfo(const nacl::string& buf, nacl::string& errmsg); | 105 bool ParseResourceInfo(const nacl::string& buf, nacl::string& errmsg); |
| 102 | 106 |
| 103 // Convenience function for reporting an error while reading the resource | 107 // Convenience function for reporting an error while reading the resource |
| 104 // info file. | 108 // info file. |
| 105 void ReadResourceInfoError(const nacl::string& msg); | 109 void ReadResourceInfoError(const nacl::string& msg); |
| 106 }; | 110 }; |
| 107 | 111 |
| 108 } // namespace plugin; | 112 } // namespace plugin; |
| 109 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 113 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
| OLD | NEW |