diff options
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/api/private/ppb_instance_private.idl | 17 | ||||
-rw-r--r-- | ppapi/api/private/ppb_nacl_private.idl | 57 | ||||
-rw-r--r-- | ppapi/c/private/ppb_instance_private.h | 25 | ||||
-rw-r--r-- | ppapi/c/private/ppb_nacl_private.h | 43 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/nacl_entry_points.h | 4 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/plugin.cc | 11 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc | 2 | ||||
-rw-r--r-- | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c | 12 |
8 files changed, 93 insertions, 78 deletions
diff --git a/ppapi/api/private/ppb_instance_private.idl b/ppapi/api/private/ppb_instance_private.idl index 25fe5a2..2ba9df3 100644 --- a/ppapi/api/private/ppb_instance_private.idl +++ b/ppapi/api/private/ppb_instance_private.idl @@ -16,6 +16,23 @@ label Chrome { }; /** + * The <code>PP_ExternalPluginResult </code> enum contains result codes from + * launching an external plugin. + */ +[assert_size(4)] +enum PP_ExternalPluginResult { + /** Successful external plugin call */ + PP_EXTERNAL_PLUGIN_OK = 0, + /** Unspecified external plugin error */ + PP_EXTERNAL_PLUGIN_FAILED = 1, + /** Error creating the module */ + PP_EXTERNAL_PLUGIN_ERROR_MODULE = 2, + /** Error creating and initializing the instance */ + PP_EXTERNAL_PLUGIN_ERROR_INSTANCE = 3 +}; + + +/** * The PPB_Instance_Private interface contains functions available only to * trusted plugin instances. * diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index c420e74..9e4e898 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -8,23 +8,9 @@ #inline c #include "ppapi/c/private/pp_file_handle.h" +#include "ppapi/c/private/ppb_instance_private.h" #endinl -/** - * The <code>PP_NaClResult</code> enum contains NaCl result codes. - */ -[assert_size(4)] -enum PP_NaClResult { - /** Successful NaCl call */ - PP_NACL_OK = 0, - /** Unspecified NaCl error */ - PP_NACL_FAILED = 1, - /** Error creating the module */ - PP_NACL_ERROR_MODULE = 2, - /** Error creating and initializing the instance */ - PP_NACL_ERROR_INSTANCE = 3 -}; - /** NaCl-specific errors that should be reported to the user */ enum PP_NaClError { /** @@ -36,9 +22,9 @@ enum PP_NaClError { /* PPB_NaCl_Private */ interface PPB_NaCl_Private { - /* Launches NaCl's sel_ldr process. Returns PP_NACL_OK on success and - * writes a NaClHandle to imc_handle. Returns PP_NACL_FAILED on failure. - * The |enable_ppapi_dev| parameter controls whether GetInterface + /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success + * and writes a NaClHandle to imc_handle. Returns PP_EXTERNAL_PLUGIN_FAILED on + * failure. The |enable_ppapi_dev| parameter controls whether GetInterface * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag * indicates that the nexe run by sel_ldr will use the PPAPI APIs. * This implies that LaunchSelLdr is run from the main thread. If a nexe @@ -50,24 +36,25 @@ interface PPB_NaCl_Private { * The |enable_exception_handling| flag indicates whether or not the nexe * will be able to use hardware exception handling. */ - PP_NaClResult LaunchSelLdr([in] PP_Instance instance, - [in] str_t alleged_url, - [in] PP_Bool uses_irt, - [in] PP_Bool uses_ppapi, - [in] PP_Bool enable_ppapi_dev, - [in] PP_Bool enable_dyncode_syscalls, - [in] PP_Bool enable_exception_handling, - [out] mem_t imc_handle, - [out] PP_Var error_message); + PP_ExternalPluginResult LaunchSelLdr([in] PP_Instance instance, + [in] str_t alleged_url, + [in] PP_Bool uses_irt, + [in] PP_Bool uses_ppapi, + [in] PP_Bool enable_ppapi_dev, + [in] PP_Bool enable_dyncode_syscalls, + [in] PP_Bool enable_exception_handling, + [out] mem_t imc_handle, + [out] PP_Var error_message); /* This function starts the IPC proxy so the nexe can communicate with the - * browser. Returns PP_NACL_OK on success, otherwise a result code indicating - * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with - * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be - * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be - * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC. + * browser. Returns PP_EXTERNAL_PLUGIN_OK on success, otherwise a result code + * indicating the failure. PP_EXTERNAL_PLUGIN_FAILED is returned if + * LaunchSelLdr wasn't called with the instance. + * PP_EXTERNAL_PLUGIN_ERROR_MODULE is returned if the module can't be + * initialized. PP_EXTERNAL_PLUGIN_ERROR_INSTANCE is returned if the instance + * can't be initialized. */ - PP_NaClResult StartPpapiProxy(PP_Instance instance); + PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance); /* On POSIX systems, this function returns the file descriptor of * /dev/urandom. On non-POSIX systems, this function returns 0. @@ -146,8 +133,8 @@ interface PPB_NaCl_Private { PP_Bool IsPnaclEnabled(); /* Display a UI message to the user. */ - PP_NaClResult ReportNaClError([in] PP_Instance instance, - [in] PP_NaClError message_id); + PP_ExternalPluginResult ReportNaClError([in] PP_Instance instance, + [in] PP_NaClError message_id); /* Opens a NaCl executable file in the application's extension directory * corresponding to the file URL and returns a file descriptor, or an invalid diff --git a/ppapi/c/private/ppb_instance_private.h b/ppapi/c/private/ppb_instance_private.h index 561374d..886613e 100644 --- a/ppapi/c/private/ppb_instance_private.h +++ b/ppapi/c/private/ppb_instance_private.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_instance_private.idl modified Mon Oct 8 10:50:04 2012. */ +/* From private/ppb_instance_private.idl modified Tue Jul 23 13:19:04 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_INSTANCE_PRIVATE_H_ @@ -26,6 +26,29 @@ /** + * @addtogroup Enums + * @{ + */ +/** + * The <code>PP_ExternalPluginResult </code> enum contains result codes from + * launching an external plugin. + */ +typedef enum { + /** Successful external plugin call */ + PP_EXTERNAL_PLUGIN_OK = 0, + /** Unspecified external plugin error */ + PP_EXTERNAL_PLUGIN_FAILED = 1, + /** Error creating the module */ + PP_EXTERNAL_PLUGIN_ERROR_MODULE = 2, + /** Error creating and initializing the instance */ + PP_EXTERNAL_PLUGIN_ERROR_INSTANCE = 3 +} PP_ExternalPluginResult; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ExternalPluginResult, 4); +/** + * @} + */ + +/** * @addtogroup Interfaces * @{ */ diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h index 9648831..bab26c5 100644 --- a/ppapi/c/private/ppb_nacl_private.h +++ b/ppapi/c/private/ppb_nacl_private.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_nacl_private.idl modified Mon Jul 15 09:19:33 2013. */ +/* From private/ppb_nacl_private.idl modified Tue Jul 23 13:16:52 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ @@ -14,6 +14,7 @@ #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_stdint.h" #include "ppapi/c/pp_var.h" +#include "ppapi/c/private/ppb_instance_private.h" #define PPB_NACL_PRIVATE_INTERFACE_1_0 "PPB_NaCl_Private;1.0" #define PPB_NACL_PRIVATE_INTERFACE PPB_NACL_PRIVATE_INTERFACE_1_0 @@ -25,26 +26,12 @@ #include "ppapi/c/private/pp_file_handle.h" +#include "ppapi/c/private/ppb_instance_private.h" /** * @addtogroup Enums * @{ */ -/** - * The <code>PP_NaClResult</code> enum contains NaCl result codes. - */ -typedef enum { - /** Successful NaCl call */ - PP_NACL_OK = 0, - /** Unspecified NaCl error */ - PP_NACL_FAILED = 1, - /** Error creating the module */ - PP_NACL_ERROR_MODULE = 2, - /** Error creating and initializing the instance */ - PP_NACL_ERROR_INSTANCE = 3 -} PP_NaClResult; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NaClResult, 4); - /** NaCl-specific errors that should be reported to the user */ typedef enum { /** @@ -77,15 +64,15 @@ struct PPB_NaCl_Private_1_0 { * The |enable_exception_handling| flag indicates whether or not the nexe * will be able to use hardware exception handling. */ - PP_NaClResult (*LaunchSelLdr)(PP_Instance instance, - const char* alleged_url, - PP_Bool uses_irt, - PP_Bool uses_ppapi, - PP_Bool enable_ppapi_dev, - PP_Bool enable_dyncode_syscalls, - PP_Bool enable_exception_handling, - void* imc_handle, - struct PP_Var* error_message); + PP_ExternalPluginResult (*LaunchSelLdr)(PP_Instance instance, + const char* alleged_url, + PP_Bool uses_irt, + PP_Bool uses_ppapi, + PP_Bool enable_ppapi_dev, + PP_Bool enable_dyncode_syscalls, + PP_Bool enable_exception_handling, + void* imc_handle, + struct PP_Var* error_message); /* This function starts the IPC proxy so the nexe can communicate with the * browser. Returns PP_NACL_OK on success, otherwise a result code indicating * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with @@ -93,7 +80,7 @@ struct PPB_NaCl_Private_1_0 { * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC. */ - PP_NaClResult (*StartPpapiProxy)(PP_Instance instance); + PP_ExternalPluginResult (*StartPpapiProxy)(PP_Instance instance); /* On POSIX systems, this function returns the file descriptor of * /dev/urandom. On non-POSIX systems, this function returns 0. */ @@ -162,8 +149,8 @@ struct PPB_NaCl_Private_1_0 { */ PP_Bool (*IsPnaclEnabled)(void); /* Display a UI message to the user. */ - PP_NaClResult (*ReportNaClError)(PP_Instance instance, - PP_NaClError message_id); + PP_ExternalPluginResult (*ReportNaClError)(PP_Instance instance, + PP_NaClError message_id); /* Opens a NaCl executable file in the application's extension directory * corresponding to the file URL and returns a file descriptor, or an invalid * handle on failure. |metadata| is left unchanged on failure. diff --git a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h index 33e4f77..4fd620d 100644 --- a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h +++ b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h @@ -14,9 +14,9 @@ #include "native_client/src/shared/imc/nacl_imc_c.h" #include "ppapi/c/pp_instance.h" -#include "ppapi/c/private/ppb_nacl_private.h" +#include "ppapi/c/private/ppb_instance_private.h" -typedef PP_NaClResult (*LaunchNaClProcessFunc)( +typedef PP_ExternalPluginResult (*LaunchNaClProcessFunc)( PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index 09a0724..3c54c26 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -482,8 +482,9 @@ bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) { "could not initialize module."); return false; } - PP_NaClResult ipc_result = nacl_interface_->StartPpapiProxy(pp_instance()); - if (ipc_result == PP_NACL_OK) { + PP_ExternalPluginResult ipc_result = + nacl_interface_->StartPpapiProxy(pp_instance()); + if (ipc_result == PP_EXTERNAL_PLUGIN_OK) { // Log the amound of time that has passed between the trusted plugin being // initialized and the untrusted plugin being initialized. This is // (roughly) the cost of using NaCl, in terms of startup time. @@ -491,13 +492,13 @@ bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) { "NaCl.Perf.StartupTime.NaClOverhead", static_cast<float>(NaClGetTimeOfDayMicroseconds() - init_time_) / NACL_MICROS_PER_MILLI); - } else if (ipc_result == PP_NACL_ERROR_MODULE) { + } else if (ipc_result == PP_EXTERNAL_PLUGIN_ERROR_MODULE) { NaClLog(LOG_ERROR, "LoadNaClModuleContinuationIntern: " - "Got PP_NACL_ERROR_MODULE\n"); + "Got PP_EXTERNAL_PLUGIN_ERROR_MODULE\n"); error_info->SetReport(ERROR_START_PROXY_MODULE, "could not initialize module."); return false; - } else if (ipc_result == PP_NACL_ERROR_INSTANCE) { + } else if (ipc_result == PP_EXTERNAL_PLUGIN_ERROR_INSTANCE) { error_info->SetReport(ERROR_START_PROXY_INSTANCE, "could not create instance."); return false; diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc index bd68de5..2714eac 100644 --- a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc +++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc @@ -38,7 +38,7 @@ bool SelLdrLauncherChrome::Start(PP_Instance instance, PP_FromBool(enable_dyncode_syscalls), PP_FromBool(enable_exception_handling), &channel_, - &var_error_message) != PP_NACL_OK) { + &var_error_message) != PP_EXTERNAL_PLUGIN_OK) { pp::Var var_error_message_cpp(pp::PASS_REF, var_error_message); if (var_error_message_cpp.is_string()) { *error_message = var_error_message_cpp.AsString(); diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index ec358bf..d543664 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -2743,12 +2743,12 @@ static void Pnacl_M13_PPB_Instance_Private_ExecuteScript(struct PP_Var* _struct_ /* Begin wrapper methods for PPB_NaCl_Private_1_0 */ -static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message) { +static PP_ExternalPluginResult Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message) { const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; return iface->LaunchSelLdr(instance, alleged_url, uses_irt, uses_ppapi, enable_ppapi_dev, enable_dyncode_syscalls, enable_exception_handling, imc_handle, error_message); } -static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy(PP_Instance instance) { +static PP_ExternalPluginResult Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy(PP_Instance instance) { const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; return iface->StartPpapiProxy(instance); } @@ -2798,7 +2798,7 @@ static PP_Bool Pnacl_M13_PPB_NaCl_Private_IsPnaclEnabled(void) { return iface->IsPnaclEnabled(); } -static PP_NaClResult Pnacl_M13_PPB_NaCl_Private_ReportNaClError(PP_Instance instance, PP_NaClError message_id) { +static PP_ExternalPluginResult Pnacl_M13_PPB_NaCl_Private_ReportNaClError(PP_Instance instance, PP_NaClError message_id) { const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; return iface->ReportNaClError(instance, message_id); } @@ -4567,8 +4567,8 @@ struct PPB_Instance_Private_0_1 Pnacl_Wrappers_PPB_Instance_Private_0_1 = { }; struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { - .LaunchSelLdr = (PP_NaClResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr, - .StartPpapiProxy = (PP_NaClResult (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy, + .LaunchSelLdr = (PP_ExternalPluginResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr, + .StartPpapiProxy = (PP_ExternalPluginResult (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_StartPpapiProxy, .UrandomFD = (int32_t (*)(void))&Pnacl_M13_PPB_NaCl_Private_UrandomFD, .Are3DInterfacesDisabled = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_Are3DInterfacesDisabled, .BrokerDuplicateHandle = (int32_t (*)(PP_FileHandle source_handle, uint32_t process_id, PP_FileHandle* target_handle, uint32_t desired_access, uint32_t options))&Pnacl_M13_PPB_NaCl_Private_BrokerDuplicateHandle, @@ -4578,7 +4578,7 @@ struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { .ReportTranslationFinished = (void (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_ReportTranslationFinished, .IsOffTheRecord = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_IsOffTheRecord, .IsPnaclEnabled = (PP_Bool (*)(void))&Pnacl_M13_PPB_NaCl_Private_IsPnaclEnabled, - .ReportNaClError = (PP_NaClResult (*)(PP_Instance instance, PP_NaClError message_id))&Pnacl_M13_PPB_NaCl_Private_ReportNaClError, + .ReportNaClError = (PP_ExternalPluginResult (*)(PP_Instance instance, PP_NaClError message_id))&Pnacl_M13_PPB_NaCl_Private_ReportNaClError, .OpenNaClExecutable = (PP_FileHandle (*)(PP_Instance instance, const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi))&Pnacl_M13_PPB_NaCl_Private_OpenNaClExecutable }; |