diff options
author | jvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-11 18:22:56 +0000 |
---|---|---|
committer | jvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-11 18:22:56 +0000 |
commit | 2e1e6f08d7af12f39932cdc5c1212c5b999c897e (patch) | |
tree | 2067063f43950984f82929ff5c8515e91989e2e4 /ppapi | |
parent | 5be80669321ce2a943d499b7d72f8e71b0c25b7a (diff) | |
download | chromium_src-2e1e6f08d7af12f39932cdc5c1212c5b999c897e.zip chromium_src-2e1e6f08d7af12f39932cdc5c1212c5b999c897e.tar.gz chromium_src-2e1e6f08d7af12f39932cdc5c1212c5b999c897e.tar.bz2 |
When launching PNaCl helper nexes, explicitly disable IRT loading.
This is done by setting the irt_fd to -1. However NaCl
currently errors out when given -1, so this depends on a
NaCl-side sel_ldr change which will understand that -1 means
skip loading: https://codereview.chromium.org/11743028/
BUG= http://code.google.com/p/nativeclient/issues/detail?id=3241
TEST= manual (patch in NaCl side CL and run PNaCl w/ TOOLS_REVISION at 10509).
Review URL: https://codereview.chromium.org/11761025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
9 files changed, 24 insertions, 2 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index f603d6b..88c88fe 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -44,9 +44,12 @@ interface PPB_NaCl_Private { * 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 * does not need PPAPI, then it can run off the main thread. + * The |uses_irt| flag indicates whether the IRT should be loaded in this + * NaCl process. This is true for ABI stable nexes. */ 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, [out] mem_t imc_handle); diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h index e89b548..7fbd563 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 Jan 7 12:49:31 2013. */ +/* From private/ppb_nacl_private.idl modified Thu Jan 10 16:07:40 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ @@ -69,9 +69,12 @@ struct PPB_NaCl_Private_1_0 { * 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 * does not need PPAPI, then it can run off the main thread. + * The |uses_irt| flag indicates whether the IRT should be loaded in this + * NaCl process. This is true for ABI stable nexes. */ PP_NaClResult (*LaunchSelLdr)(PP_Instance instance, const char* alleged_url, + PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, void* imc_handle); 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 26507b1..d40e254 100644 --- a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h +++ b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h @@ -18,6 +18,7 @@ typedef PP_NaClResult (*LaunchNaClProcessFunc)(PP_Instance instance, const char* alleged_url, + PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, nacl::Handle* result_socket); diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index 64c27c9..78de2fa 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -544,6 +544,7 @@ bool Plugin::LoadNaClModuleCommon(nacl::DescWrapper* wrapper, NaClSubprocess* subprocess, const Manifest* manifest, bool should_report_uma, + bool uses_irt, bool uses_ppapi, ErrorInfo* error_info, pp::CompletionCallback init_done_cb, @@ -564,6 +565,7 @@ bool Plugin::LoadNaClModuleCommon(nacl::DescWrapper* wrapper, new_service_runtime->Start(wrapper, error_info, manifest_base_url(), + uses_irt, uses_ppapi, enable_dev_interfaces_, crash_cb); @@ -586,6 +588,7 @@ bool Plugin::LoadNaClModule(nacl::DescWrapper* wrapper, ShutDownSubprocesses(); if (!LoadNaClModuleCommon(wrapper, &main_subprocess_, manifest_.get(), true /* should_report_uma */, + true /* uses_irt */, true /* uses_ppapi */, error_info, init_done_cb, crash_cb)) { return false; @@ -647,8 +650,13 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(nacl::DescWrapper* wrapper, // Do not report UMA stats for translator-related nexes. // TODO(sehr): define new UMA stats for translator related nexe events. + // NOTE: The PNaCl translator nexes are not built to use the IRT. This is + // done to save on address space and swap space. The PNaCl translator + // nexes also do not use PPAPI. That allows the nexes to be launched + // off of the main thread and not block the UI. if (!LoadNaClModuleCommon(wrapper, nacl_subprocess.get(), manifest, false /* should_report_uma */, + false /* uses_irt */, false /* uses_ppapi */, error_info, pp::BlockUntilComplete(), diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h index 08a436e..5d37595 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.h +++ b/ppapi/native_client/src/trusted/plugin/plugin.h @@ -350,6 +350,7 @@ class Plugin : public pp::InstancePrivate { NaClSubprocess* subprocess, const Manifest* manifest, bool should_report_uma, + bool uses_irt, bool uses_ppapi, ErrorInfo* error_info, pp::CompletionCallback init_done_cb, 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 0222558..b625dcd 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 @@ -11,11 +11,12 @@ LaunchNaClProcessFunc launch_nacl_process = NULL; namespace plugin { bool SelLdrLauncherChrome::Start(const char* url) { - return Start(0, url, true, false); + return Start(0, url, true, true, false); } bool SelLdrLauncherChrome::Start(PP_Instance instance, const char* url, + bool uses_irt, bool uses_ppapi, bool enable_ppapi_dev) { if (!launch_nacl_process) @@ -23,6 +24,7 @@ bool SelLdrLauncherChrome::Start(PP_Instance instance, // 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), &channel_) != PP_NACL_OK) { diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h index 8f3e3d27..ebcd52f 100644 --- a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h +++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h @@ -15,6 +15,7 @@ class SelLdrLauncherChrome : public nacl::SelLdrLauncherBase { virtual bool Start(const char* url); virtual bool Start(PP_Instance instance, const char* url, + bool uses_irt, bool uses_ppapi, bool enable_ppapi_dev); }; diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc index 320d989..3c38603 100644 --- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc +++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc @@ -711,6 +711,7 @@ bool ServiceRuntime::InitCommunication(nacl::DescWrapper* nacl_desc, bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, ErrorInfo* error_info, const nacl::string& url, + bool uses_irt, bool uses_ppapi, bool enable_ppapi_dev, pp::CompletionCallback crash_cb) { @@ -727,6 +728,7 @@ bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, } bool started = tmp_subprocess->Start(plugin_->pp_instance(), url.c_str(), + uses_irt, uses_ppapi, enable_ppapi_dev); if (!started) { diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h index 8ff6e0b..4934d4f 100644 --- a/ppapi/native_client/src/trusted/plugin/service_runtime.h +++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h @@ -238,6 +238,7 @@ class ServiceRuntime { bool Start(nacl::DescWrapper* nacl_file_desc, ErrorInfo* error_info, const nacl::string& url, + bool uses_irt, bool uses_ppapi, bool enable_ppapi_dev, pp::CompletionCallback crash_cb); |