Chromium Code Reviews| Index: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc |
| diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc |
| index 93d2220a14d4477ce67accc413d9739445119991..f3dd9ef3cfaad4cbe53b62e805c0cf8c9ab98ae4 100644 |
| --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc |
| +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc |
| @@ -16,7 +16,6 @@ |
| #include "ppapi/c/pp_errors.h" |
| #include "ppapi/c/private/ppb_uma_private.h" |
| -#include "ppapi/native_client/src/trusted/plugin/manifest.h" |
| #include "ppapi/native_client/src/trusted/plugin/plugin.h" |
| #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" |
| #include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h" |
| @@ -26,62 +25,6 @@ |
| namespace plugin { |
| ////////////////////////////////////////////////////////////////////// |
| -// Pnacl-specific manifest support. |
| -////////////////////////////////////////////////////////////////////// |
| - |
| -// The PNaCl linker gets file descriptors via the service runtime's |
| -// reverse service lookup. The reverse service lookup requires a manifest. |
| -// Normally, that manifest is an NMF containing mappings for shared libraries. |
| -// Here, we provide a manifest that redirects to PNaCl component files |
| -// that are part of Chrome. |
| -class PnaclManifest : public Manifest { |
| - public: |
| - PnaclManifest(const nacl::string& sandbox_arch) |
| - : sandbox_arch_(sandbox_arch) { } |
| - |
| - virtual ~PnaclManifest() { } |
| - |
| - virtual bool GetProgramURL(nacl::string* full_url, |
| - PP_PNaClOptions* pnacl_options, |
| - bool* uses_nonsfi_mode, |
| - ErrorInfo* error_info) const { |
| - // Does not contain program urls. |
| - UNREFERENCED_PARAMETER(full_url); |
| - UNREFERENCED_PARAMETER(pnacl_options); |
| - UNREFERENCED_PARAMETER(uses_nonsfi_mode); |
| - UNREFERENCED_PARAMETER(error_info); |
| - PLUGIN_PRINTF(("PnaclManifest does not contain a program\n")); |
| - error_info->SetReport(PP_NACL_ERROR_MANIFEST_GET_NEXE_URL, |
| - "pnacl manifest does not contain a program."); |
| - return false; |
| - } |
| - |
| - virtual bool ResolveKey(const nacl::string& key, |
| - nacl::string* full_url, |
| - PP_PNaClOptions* pnacl_options) const { |
| - // All of the component files are native (do not require pnacl translate). |
| - pnacl_options->translate = PP_FALSE; |
| - // We can only resolve keys in the files/ namespace. |
| - const nacl::string kFilesPrefix = "files/"; |
| - size_t files_prefix_pos = key.find(kFilesPrefix); |
| - if (files_prefix_pos == nacl::string::npos) { |
| - PLUGIN_PRINTF(("key did not start with files/")); |
| - return false; |
| - } |
| - // Resolve the full URL to the file. Provide it with a platform-specific |
| - // prefix. |
| - nacl::string key_basename = key.substr(kFilesPrefix.length()); |
| - *full_url = PnaclUrls::GetBaseUrl() + sandbox_arch_ + "/" + key_basename; |
| - return true; |
| - } |
| - |
| - private: |
| - NACL_DISALLOW_COPY_AND_ASSIGN(PnaclManifest); |
| - |
| - nacl::string sandbox_arch_; |
| -}; |
| - |
| -////////////////////////////////////////////////////////////////////// |
| // UMA stat helpers. |
| ////////////////////////////////////////////////////////////////////// |
| @@ -181,9 +124,6 @@ PnaclCoordinator* PnaclCoordinator::BitcodeToNative( |
| pnacl_options, |
| translate_notify_callback); |
| coordinator->pnacl_init_time_ = NaClGetTimeOfDayMicroseconds(); |
| - PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (manifest=%p, ", |
| - reinterpret_cast<const void*>(coordinator->manifest_.get()))); |
| - |
|
bbudge
2014/05/01 23:32:33
Is there a way to keep this output, perhaps from a
teravest
2014/05/02 14:23:15
I've restored this line and print the manifest_id_
|
| int cpus = plugin->nacl_interface()->GetNumberOfProcessors(); |
| coordinator->split_module_count_ = std::min(4, std::max(1, cpus)); |
| @@ -204,7 +144,8 @@ PnaclCoordinator::PnaclCoordinator( |
| plugin_(plugin), |
| translate_notify_callback_(translate_notify_callback), |
| translation_finished_reported_(false), |
| - manifest_(new PnaclManifest(plugin->nacl_interface()->GetSandboxArch())), |
| + manifest_id_( |
| + GetNaClInterface()->CreatePnaclManifest(plugin->pp_instance())), |
| pexe_url_(pexe_url), |
| pnacl_options_(pnacl_options), |
| split_module_count_(1), |
| @@ -668,7 +609,7 @@ void PnaclCoordinator::RunTranslate(int32_t pp_error) { |
| CHECK(translate_thread_ != NULL); |
| translate_thread_->RunTranslate(report_translate_finished, |
| - manifest_.get(), |
| + manifest_id_, |
| &obj_files_, |
| temp_nexe_file_.get(), |
| invalid_desc_wrapper_.get(), |