| 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 |
| 11 #include "native_client/src/include/nacl_macros.h" | 11 #include "native_client/src/include/nacl_macros.h" |
| 12 #include "native_client/src/include/nacl_string.h" | 12 #include "native_client/src/include/nacl_string.h" |
| 13 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 13 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| 14 | 14 |
| 15 #include "ppapi/c/private/pp_file_handle.h" | 15 #include "ppapi/c/private/pp_file_handle.h" |
| 16 #include "ppapi/cpp/completion_callback.h" | 16 #include "ppapi/cpp/completion_callback.h" |
| 17 | 17 |
| 18 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" | 18 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" |
| 19 | 19 |
| 20 namespace plugin { | 20 namespace plugin { |
| 21 | 21 |
| 22 class Plugin; | 22 class Plugin; |
| 23 class PnaclCoordinator; | 23 class PnaclCoordinator; |
| 24 | 24 |
| 25 // Constants for loading LLC and LD. | |
| 26 class PnaclUrls { | |
| 27 public: | |
| 28 static bool IsPnaclComponent(const nacl::string& full_url); | |
| 29 static nacl::string PnaclComponentURLToFilename( | |
| 30 const nacl::string& full_url); | |
| 31 }; | |
| 32 | |
| 33 // Loads a list of resources, providing a way to get file descriptors for | 25 // Loads a list of resources, providing a way to get file descriptors for |
| 34 // these resources. URLs for resources are resolved by the manifest | 26 // these resources. URLs for resources are resolved by the manifest |
| 35 // and point to pnacl component filesystem resources. | 27 // and point to pnacl component filesystem resources. |
| 36 class PnaclResources { | 28 class PnaclResources { |
| 37 public: | 29 public: |
| 38 PnaclResources(Plugin* plugin, | 30 PnaclResources(Plugin* plugin, |
| 39 PnaclCoordinator* coordinator) | 31 PnaclCoordinator* coordinator) |
| 40 : plugin_(plugin), | 32 : plugin_(plugin), |
| 41 coordinator_(coordinator), | 33 coordinator_(coordinator), |
| 42 llc_file_handle_(PP_kInvalidFileHandle), | 34 llc_file_handle_(PP_kInvalidFileHandle), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 | 65 |
| 74 // File handles for llc and ld executables, after they've been opened. | 66 // File handles for llc and ld executables, after they've been opened. |
| 75 // Only valid after the callback for StartLoad() has been called, and until | 67 // Only valid after the callback for StartLoad() has been called, and until |
| 76 // TakeLlcFileHandle()/TakeLdFileHandle() is called. | 68 // TakeLlcFileHandle()/TakeLdFileHandle() is called. |
| 77 PP_FileHandle llc_file_handle_; | 69 PP_FileHandle llc_file_handle_; |
| 78 PP_FileHandle ld_file_handle_; | 70 PP_FileHandle ld_file_handle_; |
| 79 }; | 71 }; |
| 80 | 72 |
| 81 } // namespace plugin; | 73 } // namespace plugin; |
| 82 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ | 74 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_ |
| OLD | NEW |