diff options
author | dschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 21:34:56 +0000 |
---|---|---|
committer | dschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-20 21:34:56 +0000 |
commit | 5070ab7e5f69142dd5412a49870370fd56a5c8c8 (patch) | |
tree | cb2cd48494cda8b6293a9c891851ec1481ee1439 /ppapi/native_client | |
parent | 3edd229a87ed9e5aefe6ee8f82fcca6d3d1f79e8 (diff) | |
download | chromium_src-5070ab7e5f69142dd5412a49870370fd56a5c8c8.zip chromium_src-5070ab7e5f69142dd5412a49870370fd56a5c8c8.tar.gz chromium_src-5070ab7e5f69142dd5412a49870370fd56a5c8c8.tar.bz2 |
Add new PPB_nacl_private interface for new translation cache and option in PnaclCoordinator to use it.
The PNaCl translation cache is moving to be implemented in the browser process with a disk_cache, but the PnaclCoordinator in the plugin still controls all the steps required for translation, including requesting a temp file from the browser to write the translated nexe, and determining the cache key from the bitcode's HTTP headers.In the near-term, the PnaclCoordinator will continue to coordinate the process, but the browser will remember which fd is associated with each cache key, and will store the translated nexe in the cache after translation. This CL implements the PnaclCoordinator side, using a stub implementation in the renderer which doesn't actually cache anything yet.
R=jvoung@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3372
Review URL: https://chromiumcodereview.appspot.com/17335009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/native_client')
5 files changed, 252 insertions, 67 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc index 02de2e0..12c3aa3 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc @@ -268,6 +268,9 @@ PnaclCoordinator::PnaclCoordinator( manifest_(new PnaclManifest()), pexe_url_(pexe_url), pnacl_options_(pnacl_options), + use_new_cache_(false), + is_cache_hit_(PP_FALSE), + nexe_handle_(PP_kInvalidFileHandle), error_already_reported_(false), off_the_record_(false), pnacl_init_time_(0), @@ -277,6 +280,10 @@ PnaclCoordinator::PnaclCoordinator( PLUGIN_PRINTF(("PnaclCoordinator::PnaclCoordinator (this=%p, plugin=%p)\n", static_cast<void*>(this), static_cast<void*>(plugin))); callback_factory_.Initialize(this); + if (getenv("PNACL_USE_NEW_CACHE")) { + PLUGIN_PRINTF(("PnaclCoordinator using new translation cache\n")); + use_new_cache_ = true; + } } PnaclCoordinator::~PnaclCoordinator() { @@ -668,27 +675,31 @@ void PnaclCoordinator::ResourcesDidLoad(int32_t pp_error) { } if (!off_the_record_) { - // Open the local temporary FS to see if we get a hit in the cache. - pp::CompletionCallback cb = - callback_factory_.NewCallback(&PnaclCoordinator::FileSystemDidOpen); - int32_t open_error = file_system_->Open(0, cb); - if (open_error != PP_OK_COMPLETIONPENDING) { - // At this point, no async request has kicked off to check for - // permissions, space, etc., so the only error that can be detected - // now is that an open() is already in progress (or a really terrible - // error). - if (pp_error == PP_ERROR_INPROGRESS) { + if (use_new_cache_) { + OpenBitcodeStream(); + } else { + // Open the local temporary FS to see if we get a hit in the cache. + pp::CompletionCallback cb = + callback_factory_.NewCallback(&PnaclCoordinator::FileSystemDidOpen); + int32_t open_error = file_system_->Open(0, cb); + if (open_error != PP_OK_COMPLETIONPENDING) { + // At this point, no async request has kicked off to check for + // permissions, space, etc., so the only error that can be detected + // now is that an open() is already in progress (or a really terrible + // error). + if (pp_error == PP_ERROR_INPROGRESS) { + ReportPpapiError( + ERROR_PNACL_CACHE_OPEN_INPROGRESS, + pp_error, + "File system for PNaCl translation cache failed to open " + "(in progress)."); + return; + } ReportPpapiError( - ERROR_PNACL_CACHE_OPEN_INPROGRESS, + ERROR_PNACL_CACHE_OPEN_OTHER, pp_error, - "File system for PNaCl translation cache failed to open " - "(in progress)."); - return; + "File system for PNaCl translation cache failed to open."); } - ReportPpapiError( - ERROR_PNACL_CACHE_OPEN_OTHER, - pp_error, - "File system for PNaCl translation cache failed to open."); } } else { // We don't have a cache, so do the non-cached codepath. @@ -772,12 +783,14 @@ void PnaclCoordinator::OpenBitcodeStream() { "could not allocate translation thread."); return; } - // We also want to open the object file now so the - // translator can start writing to it during streaming translation. - obj_file_.reset(new TempFile(plugin_)); - pp::CompletionCallback obj_cb = - callback_factory_.NewCallback(&PnaclCoordinator::ObjectFileDidOpen); - obj_file_->Open(obj_cb); + if (!use_new_cache_) { + // We also want to open the object file now so the + // translator can start writing to it during streaming translation. + obj_file_.reset(new TempFile(plugin_)); + pp::CompletionCallback obj_cb = + callback_factory_.NewCallback(&PnaclCoordinator::ObjectFileDidOpen); + obj_file_->Open(obj_cb, true); + } pp::CompletionCallback cb = callback_factory_.NewCallback(&PnaclCoordinator::BitcodeStreamDidOpen); @@ -813,19 +826,80 @@ void PnaclCoordinator::BitcodeStreamDidOpen(int32_t pp_error) { // people from forging the URL for a different origin. pnacl_options_.set_cache_validators(cache_validators + url); } - cached_nexe_file_.reset(new LocalTempFile( - plugin_, file_system_.get(), - nacl::string(kPnaclTempDir), - pnacl_options_.GetCacheKey())); - pp::CompletionCallback cb = - callback_factory_.NewCallback(&PnaclCoordinator::CachedFileDidOpen); - cached_nexe_file_->OpenRead(cb); + if (use_new_cache_) { + pp::CompletionCallback cb = + callback_factory_.NewCallback(&PnaclCoordinator::NexeFdDidOpen); + int32_t nexe_fd_err = + plugin_->nacl_interface()->GetNexeFd( + plugin_->pp_instance(), + pnacl_options_.GetCacheKey().c_str(), + &is_cache_hit_, + &nexe_handle_, + cb.pp_completion_callback()); + if (nexe_fd_err < PP_OK_COMPLETIONPENDING) { + ReportPpapiError(ERROR_PNACL_CREATE_TEMP, nexe_fd_err, + nacl::string("Call to GetNexeFd failed")); + return; + } + } else { + cached_nexe_file_.reset(new LocalTempFile( + plugin_, file_system_.get(), + nacl::string(kPnaclTempDir), + pnacl_options_.GetCacheKey())); + pp::CompletionCallback cb = + callback_factory_.NewCallback(&PnaclCoordinator::CachedFileDidOpen); + cached_nexe_file_->OpenRead(cb); + } } else { // No cache case. CachedFileDidOpen(PP_ERROR_FAILED); } } +void PnaclCoordinator::NexeFdDidOpen(int32_t pp_error) { + PLUGIN_PRINTF(("PnaclCoordinator::NexeFdDidOpen (pp_error=%" + NACL_PRId32", hit=%d, handle=%d)\n", pp_error, + is_cache_hit_ == PP_TRUE, + nexe_handle_)); + if (pp_error < PP_OK) { + ReportPpapiError(ERROR_PNACL_CREATE_TEMP, pp_error, + nacl::string("GetNexeFd failed")); + return; + } + temp_nexe_file_.reset(new TempFile(plugin_)); + if (!temp_nexe_file_->SetExistingFd(nexe_handle_)) { + ReportNonPpapiError( + ERROR_PNACL_CREATE_TEMP, + nacl::string("Got bad temp file handle from GetNexeFd")); + return; + } + if (is_cache_hit_ == PP_TRUE) { + // Cache hit -- no need to stream the rest of the file. + streaming_downloader_.reset(NULL); + // TODO(dschuff): update UMA stats for hit/miss once there could actually + // be hits/misses. + // Open it for reading as the cached nexe file. + pp::CompletionCallback cb = + callback_factory_.NewCallback(&PnaclCoordinator::NexeReadDidOpen); + temp_nexe_file_->Open(cb, false); + } else { + // Open an object file first so the translator can start writing to it + // during streaming translation. + obj_file_.reset(new TempFile(plugin_)); + pp::CompletionCallback obj_cb = + callback_factory_.NewCallback(&PnaclCoordinator::ObjectFileDidOpen); + obj_file_->Open(obj_cb, true); + + // Meanwhile, a miss means we know we need to stream the bitcode, so stream + // the rest of it now. (Calling FinishStreaming means that the downloader + // will begin handing data to the coordinator, which is safe any time after + // the translate_thread_ object has been initialized). + pp::CompletionCallback finish_cb = callback_factory_.NewCallback( + &PnaclCoordinator::BitcodeStreamDidFinish); + streaming_downloader_->FinishStreaming(finish_cb); + } +} + void PnaclCoordinator::CachedFileDidOpen(int32_t pp_error) { PLUGIN_PRINTF(("PnaclCoordinator::CachedFileDidOpen (pp_error=%" NACL_PRId32")\n", pp_error)); @@ -941,12 +1015,15 @@ void PnaclCoordinator::ObjectFileDidOpen(int32_t pp_error) { "Failed to open scratch object file."); return; } - // Create the nexe file for connecting ld and sel_ldr. + // Open the nexe file for connecting ld and sel_ldr. // Start translation when done with this last step of setup! - temp_nexe_file_.reset(new TempFile(plugin_)); + if (!use_new_cache_) + // In the new cache case, the TempFile has already been created. + temp_nexe_file_.reset(new TempFile(plugin_)); + pp::CompletionCallback cb = callback_factory_.NewCallback(&PnaclCoordinator::RunTranslate); - temp_nexe_file_->Open(cb); + temp_nexe_file_->Open(cb, true); } void PnaclCoordinator::RunTranslate(int32_t pp_error) { diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h index 4e89b81..e33f426 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h @@ -63,21 +63,17 @@ class TempFile; // The coordinator proceeds through several states. They are // LOAD_TRANSLATOR_BINARIES // Complete when ResourcesDidLoad is invoked. +// OPEN_BITCODE_STREAM +// Complete when BitcodeStreamDidOpen is invoked +// GET_NEXE_FD +// Get an FD which contains the cached nexe, or is writeable for +// translation output. Complete when NexeFdDidOpen is called. // -// If cache is enabled: -// OPEN_LOCAL_FILE_SYSTEM -// Complete when FileSystemDidOpen is invoked. -// CREATED_PNACL_TEMP_DIRECTORY -// Complete when DirectoryWasCreated is invoked. -// CACHED_FILE_OPEN -// Complete with success if cached version is available and jump to end. -// Otherwise, proceed with usual pipeline of translation. -// +// If there was a cache hit, go to OPEN_NEXE_FOR_SEL_LDR, otherwise, +// continue streaming the bitcode, and: // OPEN_TMP_FOR_LLC_TO_LD_COMMUNICATION // Complete when ObjectFileDidOpen is invoked. -// OPEN_TMP_FOR_LD_WRITING -// Complete when NexeWriteDidOpen is invoked. -// PREPARE_PEXE_FOR_STREAMING +// OPEN_NEXE_FD_FOR_WRITING // Complete when RunTranslate is invoked. // START_LD_AND_LLC_SUBPROCESS_AND_INITIATE_TRANSLATION // Complete when RunTranslate returns. @@ -85,12 +81,7 @@ class TempFile; // Complete when TranslateFinished is invoked. // // If cache is enabled: -// OPEN_CACHE_FOR_WRITE -// Complete when CachedNexeOpenedForWrite is invoked -// COPY_NEXE_TO_CACHE -// Complete when NexeWasCopiedToCache is invoked. -// RENAME_CACHE_FILE -// Complete when NexeFileWasRenamed is invoked. +// TODO: notify browser of finished translation (and re-open read-only?) // // OPEN_NEXE_FOR_SEL_LDR // Complete when NexeReadDidOpen is invoked. @@ -175,6 +166,9 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> { // Invoked when we've started an URL fetch for the pexe to check for // caching metadata. void BitcodeStreamDidOpen(int32_t pp_error); + // Invoked when we've gotten a temp FD for the nexe, either with the nexe + // data, or a writeable fd to save to. + void NexeFdDidOpen(int32_t pp_error); // Invoked after we have checked the PNaCl cache for a translated version. void CachedFileDidOpen(int32_t pp_error); // Invoked when a pexe data chunk arrives (when using streaming translation) @@ -250,6 +244,15 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> { // not have a writeable cache file. That is currently the case when // off_the_record_ is true. nacl::scoped_ptr<LocalTempFile> cached_nexe_file_; + // True if the new cache flow is enabled. Currently set by an environment + // variable on construction. TODO(dschuff): remove old cache stuff. + bool use_new_cache_; + // Passed to the browser, which sets it to true if there is a translation + // cache hit. + PP_Bool is_cache_hit_; + // Passed to the browser, which sets it to the handle for the nexe file + // (either the translated nexe from the cache, or a temp file to write to). + PP_FileHandle nexe_handle_; // Downloader for streaming translation nacl::scoped_ptr<FileDownloader> streaming_downloader_; diff --git a/ppapi/native_client/src/trusted/plugin/temporary_file.cc b/ppapi/native_client/src/trusted/plugin/temporary_file.cc index fe8b779..321616c 100644 --- a/ppapi/native_client/src/trusted/plugin/temporary_file.cc +++ b/ppapi/native_client/src/trusted/plugin/temporary_file.cc @@ -24,7 +24,8 @@ namespace plugin { uint32_t TempFile::next_identifier = 0; -TempFile::TempFile(Plugin* plugin) : plugin_(plugin) { +TempFile::TempFile(Plugin* plugin) : plugin_(plugin), + existing_handle_(PP_kInvalidFileHandle) { PLUGIN_PRINTF(("TempFile::TempFile\n")); ++next_identifier; SNPRINTF(reinterpret_cast<char *>(identifier_), sizeof identifier_, @@ -35,10 +36,23 @@ TempFile::~TempFile() { PLUGIN_PRINTF(("TempFile::~TempFile\n")); } -void TempFile::Open(const pp::CompletionCallback& cb) { +bool TempFile::SetExistingFd(PP_FileHandle handle) { + // Check if we got a bad handle or if Open has already been called. + if (handle == PP_kInvalidFileHandle || read_wrapper_.get() != NULL) + return false; + existing_handle_ = handle; + return true; +} + +void TempFile::Open(const pp::CompletionCallback& cb, bool writeable) { PLUGIN_PRINTF(("TempFile::Open\n")); - PP_FileHandle file_handle = - plugin_->nacl_interface()->CreateTemporaryFile(plugin_->pp_instance()); + PP_FileHandle file_handle; + if (existing_handle_ == PP_kInvalidFileHandle) { + file_handle = + plugin_->nacl_interface()->CreateTemporaryFile(plugin_->pp_instance()); + } else { + file_handle = existing_handle_; + } pp::Core* core = pp::Module::Get()->core(); if (file_handle == PP_kInvalidFileHandle) { @@ -50,8 +64,9 @@ void TempFile::Open(const pp::CompletionCallback& cb) { HANDLE handle = file_handle; //////// Now try the posix view. + int rdwr_flag = writeable ? _O_RDWR : _O_RDONLY; int32_t posix_desc = _open_osfhandle(reinterpret_cast<intptr_t>(handle), - _O_RDWR | _O_BINARY + rdwr_flag | _O_BINARY | _O_TEMPORARY | _O_SHORT_LIVED ); if (posix_desc == -1) { PLUGIN_PRINTF(("TempFile::Open failed to convert HANDLE to posix\n")); @@ -81,8 +96,10 @@ void TempFile::Open(const pp::CompletionCallback& cb) { } // The descriptor for a writeable file needs to have quota management. - write_wrapper_.reset( - plugin_->wrapper_factory()->MakeFileDescQuota(fd, O_RDWR, identifier_)); + if (writeable) { + write_wrapper_.reset( + plugin_->wrapper_factory()->MakeFileDescQuota(fd, O_RDWR, identifier_)); + } read_wrapper_.reset( plugin_->wrapper_factory()->MakeFileDesc(read_fd, O_RDONLY)); core->CallOnMainThread(0, cb, PP_OK); @@ -90,10 +107,10 @@ void TempFile::Open(const pp::CompletionCallback& cb) { bool TempFile::Reset() { PLUGIN_PRINTF(("TempFile::Reset\n")); - // Use the write_wrapper_ to reset the file pos. The read_wrapper_ is also + // Use the read_wrapper_ to reset the file pos. The write_wrapper_ is also // backed by the same file, so it should also reset. - CHECK(write_wrapper_.get() != NULL); - nacl_off64_t newpos = write_wrapper_->Seek(0, SEEK_SET); + CHECK(read_wrapper_.get() != NULL); + nacl_off64_t newpos = read_wrapper_->Seek(0, SEEK_SET); return newpos >= 0; } diff --git a/ppapi/native_client/src/trusted/plugin/temporary_file.h b/ppapi/native_client/src/trusted/plugin/temporary_file.h index 0fe6d26..966945c 100644 --- a/ppapi/native_client/src/trusted/plugin/temporary_file.h +++ b/ppapi/native_client/src/trusted/plugin/temporary_file.h @@ -9,6 +9,7 @@ #include "native_client/src/include/nacl_string.h" #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" +#include "ppapi/c/private/pp_file_handle.h" #include "ppapi/cpp/completion_callback.h" namespace plugin { @@ -40,8 +41,13 @@ class TempFile { explicit TempFile(Plugin* plugin); ~TempFile(); - // Opens a writeable file IO object and descriptor referring to the file. - void Open(const pp::CompletionCallback& cb); + // Set an existing Fd instead of getting one from the nacl interface on open. + // Must be called before Open. + bool SetExistingFd(PP_FileHandle handle); + // Opens a temporary file object and descriptor wrapper referring to the file. + // If |writeable| is true, the descriptor will be opened for writing, and + // write_wrapper will return a valid pointer, otherwise it will return NULL. + void Open(const pp::CompletionCallback& cb, bool writeable); // Resets file position of the handle, for reuse. bool Reset(); @@ -64,6 +70,7 @@ class TempFile { Plugin* plugin_; nacl::scoped_ptr<nacl::DescWrapper> read_wrapper_; nacl::scoped_ptr<nacl::DescWrapper> write_wrapper_; + PP_FileHandle existing_handle_; // An identifier string used for quota request processing. The quota // interface needs a string that is unique per sel_ldr instance only, so 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 8310eb7..96bd988 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 @@ -2741,7 +2741,74 @@ static void Pnacl_M13_PPB_Instance_Private_ExecuteScript(struct PP_Var* _struct_ /* End wrapper methods for PPB_Instance_Private_0_1 */ -/* Not generating wrapper methods for PPB_NaCl_Private_1_0 */ +/* 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) { + 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); +} + +static PP_NaClResult 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); +} + +static int32_t Pnacl_M13_PPB_NaCl_Private_UrandomFD(void) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->UrandomFD(); +} + +static PP_Bool Pnacl_M13_PPB_NaCl_Private_Are3DInterfacesDisabled(void) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->Are3DInterfacesDisabled(); +} + +static void Pnacl_M13_PPB_NaCl_Private_EnableBackgroundSelLdrLaunch(void) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + iface->EnableBackgroundSelLdrLaunch(); +} + +static int32_t Pnacl_M13_PPB_NaCl_Private_BrokerDuplicateHandle(PP_FileHandle source_handle, uint32_t process_id, PP_FileHandle* target_handle, uint32_t desired_access, uint32_t options) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->BrokerDuplicateHandle(source_handle, process_id, target_handle, desired_access, options); +} + +static PP_FileHandle Pnacl_M13_PPB_NaCl_Private_GetReadonlyPnaclFd(const char* filename) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->GetReadonlyPnaclFd(filename); +} + +static PP_FileHandle Pnacl_M13_PPB_NaCl_Private_CreateTemporaryFile(PP_Instance instance) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->CreateTemporaryFile(instance); +} + +static int32_t Pnacl_M13_PPB_NaCl_Private_GetNexeFd(PP_Instance instance, const char* cache_key, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback* callback) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->GetNexeFd(instance, cache_key, is_hit, nexe_handle, *callback); +} + +static PP_Bool Pnacl_M13_PPB_NaCl_Private_IsOffTheRecord(void) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->IsOffTheRecord(); +} + +static PP_Bool Pnacl_M13_PPB_NaCl_Private_IsPnaclEnabled(void) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->IsPnaclEnabled(); +} + +static PP_NaClResult 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); +} + +static PP_FileHandle Pnacl_M13_PPB_NaCl_Private_OpenNaClExecutable(PP_Instance instance, const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + return iface->OpenNaClExecutable(instance, file_url, file_token_lo, file_token_hi); +} + +/* End wrapper methods for PPB_NaCl_Private_1_0 */ /* Begin wrapper methods for PPB_NetAddress_Private_0_1 */ @@ -4481,7 +4548,21 @@ struct PPB_Instance_Private_0_1 Pnacl_Wrappers_PPB_Instance_Private_0_1 = { .ExecuteScript = (struct PP_Var (*)(PP_Instance instance, struct PP_Var script, struct PP_Var* exception))&Pnacl_M13_PPB_Instance_Private_ExecuteScript }; -/* Not generating wrapper interface for PPB_NaCl_Private_1_0 */ +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))&Pnacl_M13_PPB_NaCl_Private_LaunchSelLdr, + .StartPpapiProxy = (PP_NaClResult (*)(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, + .EnableBackgroundSelLdrLaunch = (void (*)(void))&Pnacl_M13_PPB_NaCl_Private_EnableBackgroundSelLdrLaunch, + .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, + .GetReadonlyPnaclFd = (PP_FileHandle (*)(const char* filename))&Pnacl_M13_PPB_NaCl_Private_GetReadonlyPnaclFd, + .CreateTemporaryFile = (PP_FileHandle (*)(PP_Instance instance))&Pnacl_M13_PPB_NaCl_Private_CreateTemporaryFile, + .GetNexeFd = (int32_t (*)(PP_Instance instance, const char* cache_key, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback callback))&Pnacl_M13_PPB_NaCl_Private_GetNexeFd, + .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, + .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 +}; struct PPB_NetAddress_Private_0_1 Pnacl_Wrappers_PPB_NetAddress_Private_0_1 = { .AreEqual = (PP_Bool (*)(const struct PP_NetAddress_Private* addr1, const struct PP_NetAddress_Private* addr2))&Pnacl_M17_PPB_NetAddress_Private_AreEqual, @@ -5486,7 +5567,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Instance_Private_0_1 = { static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NaCl_Private_1_0 = { .iface_macro = PPB_NACL_PRIVATE_INTERFACE_1_0, - .wrapped_iface = NULL /* Still need slot for real_iface */, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NaCl_Private_1_0, .real_iface = NULL }; |