Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / ppapi / native_client / src / trusted / plugin / pnacl_resources.h
index cca3b54..c0f2968 100644 (file)
@@ -12,7 +12,7 @@
 #include "native_client/src/include/nacl_string.h"
 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
 
-#include "ppapi/c/private/pp_file_handle.h"
+#include "ppapi/c/private/ppb_nacl_private.h"
 #include "ppapi/cpp/completion_callback.h"
 
 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
@@ -26,27 +26,21 @@ class Plugin;
 // and point to pnacl component filesystem resources.
 class PnaclResources {
  public:
-  explicit PnaclResources(Plugin* plugin)
-      : plugin_(plugin),
-        llc_file_handle_(PP_kInvalidFileHandle),
-        ld_file_handle_(PP_kInvalidFileHandle) {
-  }
+  explicit PnaclResources(Plugin* plugin);
   virtual ~PnaclResources();
 
   // Read the resource info JSON file.  This is the first step after
   // construction; it has to be completed before StartLoad is called.
-  virtual void ReadResourceInfo(
-      const pp::CompletionCallback& resource_info_read_cb);
+  bool ReadResourceInfo();
 
   // Start loading the resources.
-  virtual void StartLoad(
-      const pp::CompletionCallback& all_loaded_callback);
+  bool StartLoad();
 
   const nacl::string& GetLlcUrl() { return llc_tool_name_; }
   const nacl::string& GetLdUrl() { return ld_tool_name_; }
 
-  PP_FileHandle TakeLlcFileHandle();
-  PP_FileHandle TakeLdFileHandle();
+  PP_NaClFileInfo TakeLlcFileInfo();
+  PP_NaClFileInfo TakeLdFileInfo();
 
  private:
   NACL_DISALLOW_COPY_AND_ASSIGN(PnaclResources);
@@ -58,12 +52,12 @@ class PnaclResources {
   nacl::string llc_tool_name_;
   nacl::string ld_tool_name_;
 
-  // File handles for llc and ld executables, after they've been opened.
+  // File info for llc and ld executables, after they've been opened.
   // Only valid after the callback for StartLoad() has been called, and until
-  // TakeLlcFileHandle()/TakeLdFileHandle() is called.
-  PP_FileHandle llc_file_handle_;
-  PP_FileHandle ld_file_handle_;
+  // TakeLlcFileInfo()/TakeLdFileInfo() is called.
+  PP_NaClFileInfo llc_file_info_;
+  PP_NaClFileInfo ld_file_info_;
 };
 
-}  // namespace plugin;
+}  // namespace plugin
 #endif  // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_RESOURCES_H_