diff options
Diffstat (limited to 'chromium/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc')
-rw-r--r-- | chromium/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/chromium/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc b/chromium/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc index 486696bce53..46d636729db 100644 --- a/chromium/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc +++ b/chromium/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc @@ -3,12 +3,10 @@ // found in the LICENSE file. #include "native_client/src/include/nacl_macros.h" -#include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" +#include "ppapi/c/pp_errors.h" +#include "ppapi/cpp/module.h" #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" - -#include "ppapi/cpp/var.h" - -LaunchNaClProcessFunc launch_nacl_process = NULL; +#include "ppapi/native_client/src/trusted/plugin/utility.h" namespace plugin { @@ -17,37 +15,39 @@ bool SelLdrLauncherChrome::Start(const char* url) { return false; } -bool SelLdrLauncherChrome::Start(PP_Instance instance, - const char* url, - bool uses_irt, - bool uses_ppapi, - bool enable_ppapi_dev, - bool enable_dyncode_syscalls, - bool enable_exception_handling, - bool enable_crash_throttling, - nacl::string* error_message) { - *error_message = ""; - if (!launch_nacl_process) - return false; - PP_Var var_error_message; - // send a synchronous message to the browser process - if (launch_nacl_process(instance, - url, - PP_FromBool(uses_irt), - PP_FromBool(uses_ppapi), - PP_FromBool(enable_ppapi_dev), - PP_FromBool(enable_dyncode_syscalls), - PP_FromBool(enable_exception_handling), - PP_FromBool(enable_crash_throttling), - &channel_, - &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(); - } - return false; +void SelLdrLauncherChrome::Start( + PP_Instance instance, + bool main_service_runtime, + const char* url, + bool uses_irt, + bool uses_ppapi, + bool uses_nonsfi_mode, + bool enable_ppapi_dev, + bool enable_dyncode_syscalls, + bool enable_exception_handling, + bool enable_crash_throttling, + const PPP_ManifestService* manifest_service_interface, + void* manifest_service_user_data, + pp::CompletionCallback callback) { + if (!GetNaClInterface()) { + pp::Module::Get()->core()->CallOnMainThread(0, callback, PP_ERROR_FAILED); + return; } - return true; + GetNaClInterface()->LaunchSelLdr( + instance, + PP_FromBool(main_service_runtime), + url, + PP_FromBool(uses_irt), + PP_FromBool(uses_ppapi), + PP_FromBool(uses_nonsfi_mode), + PP_FromBool(enable_ppapi_dev), + PP_FromBool(enable_dyncode_syscalls), + PP_FromBool(enable_exception_handling), + PP_FromBool(enable_crash_throttling), + manifest_service_interface, + manifest_service_user_data, + &channel_, + callback.pp_completion_callback()); } } // namespace plugin |