X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fppapi%2Fnative_client%2Fsrc%2Ftrusted%2Fplugin%2Fplugin.h;h=ce3273dd2cb88f8572c3456725c5431398030944;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=dbfcac61faf2b254e346414451035ff4cd46b5e6;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ppapi/native_client/src/trusted/plugin/plugin.h b/src/ppapi/native_client/src/trusted/plugin/plugin.h index dbfcac6..ce3273d 100644 --- a/src/ppapi/native_client/src/trusted/plugin/plugin.h +++ b/src/ppapi/native_client/src/trusted/plugin/plugin.h @@ -28,12 +28,13 @@ #include "ppapi/cpp/var.h" #include "ppapi/cpp/view.h" -#include "ppapi/native_client/src/trusted/plugin/file_downloader.h" #include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h" #include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h" #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" #include "ppapi/native_client/src/trusted/plugin/utility.h" +#include "ppapi/utility/completion_callback_factory.h" + namespace nacl { class DescWrapper; class DescWrapperFactory; @@ -52,6 +53,12 @@ class Manifest; int32_t ConvertFileDescriptor(PP_FileHandle handle); +const PP_NaClFileInfo kInvalidNaClFileInfo = { + PP_kInvalidFileHandle, + 0, // token_lo + 0, // token_hi +}; + class Plugin : public pp::Instance { public: explicit Plugin(PP_Instance instance); @@ -102,12 +109,12 @@ class Plugin : public pp::Instance { bool LoadNaClModuleContinuation(int32_t pp_error); // Load support. - // A helper SRPC NaCl module can be loaded given a PP_FileHandle. + // A helper SRPC NaCl module can be loaded given a PP_NaClFileInfo. // Blocks until the helper module signals initialization is done. // Does not update nacl_module_origin(). // Returns NULL or the NaClSubprocess of the new helper NaCl module. NaClSubprocess* LoadHelperNaClModule(const nacl::string& helper_url, - PP_FileHandle file_handle, + PP_NaClFileInfo file_info, ErrorInfo* error_info); // Report an error that was encountered while loading a module. @@ -140,13 +147,12 @@ class Plugin : public pp::Instance { // uma_interface_ normally. void HistogramTimeSmall(const std::string& name, int64_t ms); - // Load a nacl module from the file specified in file_handle. + // Loads and starts a helper (e.g. llc, ld) NaCl module. // Only to be used from a background (non-main) thread for the PNaCl // translator. This will fully initialize the |subprocess| if the load was // successful. - bool LoadHelperNaClModule(PP_FileHandle file_handle, - NaClSubprocess* subprocess, - const SelLdrStartParams& params); + bool LoadHelperNaClModuleInternal(NaClSubprocess* subprocess, + const SelLdrStartParams& params); // Start sel_ldr from the main thread, given the start params. // |pp_error| is set by CallOnMainThread (should be PP_OK). @@ -161,17 +167,8 @@ class Plugin : public pp::Instance { bool* started, ServiceRuntime* service_runtime); - // Signals that the nexe is started. // This is invoked on the main thread. - void SignalNexeStarted(int32_t pp_error, - bool* started, - ServiceRuntime* service_runtime); - - // This is invoked on the main thread. - void LoadNexeAndStart(int32_t pp_error, - ServiceRuntime* service_runtime, - PP_NaClFileInfo file_info, - const pp::CompletionCallback& callback); + void StartNexe(int32_t pp_error, ServiceRuntime* service_runtime); // Callback used when getting the URL for the .nexe file. If the URL loading // is successful, the file descriptor is opened and can be passed to sel_ldr @@ -218,9 +215,6 @@ class Plugin : public pp::Instance { nacl::DescWrapperFactory* wrapper_factory_; - // Original, unresolved URL for the .nexe program to load. - std::string program_url_; - pp::CompletionCallbackFactory callback_factory_; nacl::scoped_ptr pnacl_coordinator_;