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 6ce36469c42e29b8f4d203662042b4c508606ec2..537ac066f1bef42f1ff59e70be9dfbbce1ffcca6 100644 |
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc |
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc |
@@ -338,8 +338,7 @@ void PnaclCoordinator::BitcodeStreamCacheHit(PP_FileHandle handle) { |
BitcodeStreamDidFinish(PP_ERROR_FAILED); |
return; |
} |
- *temp_nexe_file_->internal_handle() = handle; |
- // Open it for reading as the cached nexe file. |
+ temp_nexe_file_.reset(new TempFile(plugin_, handle)); |
NexeReadDidOpen(temp_nexe_file_->Open(false)); |
} |
@@ -347,12 +346,10 @@ void PnaclCoordinator::BitcodeStreamCacheMiss(int64_t expected_pexe_size) { |
HistogramEnumerateTranslationCache(plugin_->uma_interface(), false); |
expected_pexe_size_ = expected_pexe_size; |
- // Open an object file first so the translator can start writing to it |
- // during streaming translation. |
- temp_nexe_file_.reset(new TempFile(plugin_)); |
- |
for (int i = 0; i < split_module_count_; i++) { |
- nacl::scoped_ptr<TempFile> temp_file(new TempFile(plugin_)); |
+ PP_FileHandle obj_handle = |
+ plugin_->nacl_interface()->CreateTemporaryFile(plugin_->pp_instance()); |
+ nacl::scoped_ptr<TempFile> temp_file(new TempFile(plugin_, obj_handle)); |
int32_t pp_error = temp_file->Open(true); |
if (pp_error != PP_OK) { |
ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP, |
@@ -367,6 +364,9 @@ void PnaclCoordinator::BitcodeStreamCacheMiss(int64_t expected_pexe_size) { |
// Open the nexe file for connecting ld and sel_ldr. |
// Start translation when done with this last step of setup! |
+ PP_FileHandle nexe_handle = |
+ plugin_->nacl_interface()->CreateTemporaryFile(plugin_->pp_instance()); |
+ temp_nexe_file_.reset(new TempFile(plugin_, nexe_handle)); |
RunTranslate(temp_nexe_file_->Open(true)); |
} |