diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 22:30:20 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 22:30:20 +0000 |
commit | ade946b0f3caa36e82ce2bf0a58da556c0b329c7 (patch) | |
tree | a1b74335b243bce1d712204643fec65d95c003cc /ppapi/native_client | |
parent | f6257e3f6b5ef909bb35b8e410d6f6a0b04295d1 (diff) | |
download | chromium_src-ade946b0f3caa36e82ce2bf0a58da556c0b329c7.zip chromium_src-ade946b0f3caa36e82ce2bf0a58da556c0b329c7.tar.gz chromium_src-ade946b0f3caa36e82ce2bf0a58da556c0b329c7.tar.bz2 |
Add an instance parameter to PPB_NaCl_Private::LaunchSelLdr.
BUG=116317
TEST=compiles
Review URL: https://chromiumcodereview.appspot.com/10343005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137272 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/native_client')
4 files changed, 26 insertions, 6 deletions
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 7c60ad8..8074e5f 100644 --- a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h +++ b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h @@ -13,16 +13,21 @@ #include <string> #include "native_client/src/shared/imc/nacl_imc.h" +#include "ppapi/c/pp_instance.h" -typedef bool (*LaunchNaClProcessFunc)(const char* url, +typedef bool (*LaunchNaClProcessFunc)(PP_Instance instance, + const char* url, int socket_count, nacl::Handle* result_sockets); +typedef bool (*StartPpapiProxyFunc)(PP_Instance instance); + typedef int (*GetURandomFDFunc)(void); extern LaunchNaClProcessFunc launch_nacl_process; +extern StartPpapiProxyFunc start_ppapi_proxy; extern GetURandomFDFunc get_urandom_fd; #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NACL_ENTRY_POINTS_H_ 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 c32209b..d301612 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,18 @@ LaunchNaClProcessFunc launch_nacl_process = NULL; namespace plugin { bool SelLdrLauncherChrome::Start(const char* url) { + return Start(0, url); +} + +bool SelLdrLauncherChrome::Start(PP_Instance instance, const char* url) { // send a synchronous message to the browser process // TODO(sehr): This is asserted to be one. Remove this parameter. static const int kNumberOfChannelsToBeCreated = 1; if (!launch_nacl_process || - !launch_nacl_process(url, kNumberOfChannelsToBeCreated, &channel_)) { + !launch_nacl_process(instance, + url, + kNumberOfChannelsToBeCreated, + &channel_)) { return false; } return true; 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 2450cf3..e479499 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 @@ -6,12 +6,14 @@ #define PPAPI_NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SEL_LDR_LAUNCHER_CHROME_H_ #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" +#include "ppapi/c/pp_instance.h" namespace plugin { class SelLdrLauncherChrome : public nacl::SelLdrLauncherBase { public: virtual bool Start(const char* url); + virtual bool Start(PP_Instance instance, const char* url); }; } // namespace plugin diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc index 8a75b1e..f5b948a 100644 --- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc +++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc @@ -628,11 +628,12 @@ bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n", reinterpret_cast<void*>(nacl_desc))); - nacl::scoped_ptr<nacl::SelLdrLauncherBase> tmp_subprocess; #ifdef NACL_STANDALONE - tmp_subprocess.reset(new nacl::SelLdrLauncherStandalone()); + nacl::scoped_ptr<nacl::SelLdrLauncherStandalone> + tmp_subprocess(new nacl::SelLdrLauncherStandalone()); #else - tmp_subprocess.reset(new SelLdrLauncherChrome()); + nacl::scoped_ptr<SelLdrLauncherChrome> + tmp_subprocess(new SelLdrLauncherChrome()); #endif if (NULL == tmp_subprocess.get()) { PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); @@ -640,7 +641,12 @@ bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, "ServiceRuntime: failed to create sel_ldr launcher"); return false; } - if (!tmp_subprocess->Start(url.c_str())) { +#ifdef NACL_STANDALONE + bool started = tmp_subprocess->Start(url.c_str()); +#else + bool started = tmp_subprocess->Start(plugin_->pp_instance(), url.c_str()); +#endif + if (!started) { PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); error_info->SetReport(ERROR_SEL_LDR_LAUNCH, "ServiceRuntime: failed to start"); |