diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-23 20:12:36 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-23 20:12:36 +0000 |
commit | 75e9e3fd9005898573c3d54bde88318f29fe5325 (patch) | |
tree | 5dd285328a151c8b64bcfd5547df91e02443facd /ppapi | |
parent | 8b248450eeb6e077ed43d84a88bc46e0f74b5e61 (diff) | |
download | chromium_src-75e9e3fd9005898573c3d54bde88318f29fe5325.zip chromium_src-75e9e3fd9005898573c3d54bde88318f29fe5325.tar.gz chromium_src-75e9e3fd9005898573c3d54bde88318f29fe5325.tar.bz2 |
Pepper: Simplify Pnacl manifest id logic.
This removes some unnecessary manifest_id storage and passing to make manifest
behavior clearer in the trusted plugin. Helper NaCl Modules (llc and ld) always
use the "Pnacl Manifest" for resolving keys, as there is no relevant
json-formatted NMF available.
BUG=239656
R=dmichael@chromium.org
Review URL: https://codereview.chromium.org/292743011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
6 files changed, 6 insertions, 17 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index f9f9929..c7b7fcc 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -253,7 +253,6 @@ bool Plugin::LoadNaClModuleContinuationIntern() { NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url, PP_FileHandle file_handle, - int32_t manifest_id, ErrorInfo* error_info) { nacl::scoped_ptr<NaClSubprocess> nacl_subprocess( new NaClSubprocess("helper module", NULL, NULL)); @@ -279,6 +278,10 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url, false /* enable_dyncode_syscalls */, false /* enable_exception_handling */, true /* enable_crash_throttling */); + + // Helper NaCl modules always use the PNaCl manifest, as there is no + // corresponding NMF. + int32_t manifest_id = nacl_interface_->CreatePnaclManifest(pp_instance()); if (!LoadNaClModuleFromBackgroundThread(file_handle, nacl_subprocess.get(), manifest_id, params)) { return NULL; diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h index 9bec79a..5cc2aac 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.h +++ b/ppapi/native_client/src/trusted/plugin/plugin.h @@ -113,7 +113,6 @@ class Plugin : public pp::Instance { // Returns NULL or the NaClSubprocess of the new helper NaCl module. NaClSubprocess* LoadHelperNaClModule(const nacl::string& helper_url, PP_FileHandle file_handle, - int32_t manifest_id, ErrorInfo* error_info); enum LengthComputable { diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc index 27c75c7..831ba86 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc @@ -129,8 +129,6 @@ PnaclCoordinator* PnaclCoordinator::BitcodeToNative( new PnaclCoordinator(plugin, pexe_url, pnacl_options, translate_notify_callback); - PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (manifest_id=%d)\n", - coordinator->manifest_id_)); coordinator->pnacl_init_time_ = NaClGetTimeOfDayMicroseconds(); int cpus = plugin->nacl_interface()->GetNumberOfProcessors(); @@ -153,8 +151,6 @@ PnaclCoordinator::PnaclCoordinator( plugin_(plugin), translate_notify_callback_(translate_notify_callback), translation_finished_reported_(false), - manifest_id_( - GetNaClInterface()->CreatePnaclManifest(plugin->pp_instance())), pexe_url_(pexe_url), pnacl_options_(pnacl_options), architecture_attributes_(GetArchitectureAttributes(plugin)), @@ -619,7 +615,6 @@ void PnaclCoordinator::RunTranslate(int32_t pp_error) { CHECK(translate_thread_ != NULL); translate_thread_->RunTranslate(report_translate_finished, - manifest_id_, &obj_files_, temp_nexe_file_.get(), invalid_desc_wrapper_.get(), diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h index 058f9ac..1e6ec8d 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h @@ -201,9 +201,6 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> { pp::CompletionCallbackFactory<PnaclCoordinator, pp::ThreadSafeThreadTraits> callback_factory_; - // The manifest used by resource loading and ld + llc's reverse service - // to look up objects and libraries. - int32_t manifest_id_; // An auxiliary class that manages downloaded resources (llc and ld nexes). nacl::scoped_ptr<PnaclResources> resources_; diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc index eb3a601..43e9fa5 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc @@ -56,7 +56,6 @@ PnaclTranslateThread::PnaclTranslateThread() : llc_subprocess_active_(false), ld_subprocess_active_(false), done_(false), compile_time_(0), - manifest_id_(0), obj_files_(NULL), nexe_file_(NULL), coordinator_error_info_(NULL), @@ -70,7 +69,6 @@ PnaclTranslateThread::PnaclTranslateThread() : llc_subprocess_active_(false), void PnaclTranslateThread::RunTranslate( const pp::CompletionCallback& finish_callback, - int32_t manifest_id, const std::vector<TempFile*>* obj_files, TempFile* nexe_file, nacl::DescWrapper* invalid_desc_wrapper, @@ -81,7 +79,6 @@ void PnaclTranslateThread::RunTranslate( PnaclCoordinator* coordinator, Plugin* plugin) { PLUGIN_PRINTF(("PnaclStreamingTranslateThread::RunTranslate)\n")); - manifest_id_ = manifest_id; obj_files_ = obj_files; nexe_file_ = nexe_file; invalid_desc_wrapper_ = invalid_desc_wrapper; @@ -170,7 +167,7 @@ void PnaclTranslateThread::DoTranslate() { // On success, ownership of llc_file_handle is transferred. llc_subprocess_.reset(plugin_->LoadHelperNaClModule( - resources_->GetLlcUrl(), llc_file_handle, manifest_id_, &error_info)); + resources_->GetLlcUrl(), llc_file_handle, &error_info)); if (llc_subprocess_.get() == NULL) { if (llc_file_handle != PP_kInvalidFileHandle) CloseFileHandle(llc_file_handle); @@ -341,7 +338,7 @@ bool PnaclTranslateThread::RunLdSubprocess() { // On success, ownership of ld_file_handle is transferred. ld_subprocess_.reset(plugin_->LoadHelperNaClModule( - resources_->GetLdUrl(), ld_file_handle, manifest_id_, &error_info)); + resources_->GetLdUrl(), ld_file_handle, &error_info)); if (ld_subprocess_ == NULL) { if (ld_file_handle != PP_kInvalidFileHandle) CloseFileHandle(ld_file_handle); diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h index 77152e3..4cdc304 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h +++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h @@ -42,7 +42,6 @@ class PnaclTranslateThread { // Start the translation process. It will continue to run and consume data // as it is passed in with PutBytes. void RunTranslate(const pp::CompletionCallback& finish_callback, - int32_t manifest_id, const std::vector<TempFile*>* obj_files, TempFile* nexe_file, nacl::DescWrapper* invalid_desc_wrapper, @@ -110,7 +109,6 @@ class PnaclTranslateThread { int64_t compile_time_; // Data about the translation files, owned by the coordinator - int32_t manifest_id_; const std::vector<TempFile*>* obj_files_; TempFile* nexe_file_; nacl::DescWrapper* invalid_desc_wrapper_; |