Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: trunk/src/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc

Issue 406383002: Revert 284766 "Pepper: Simplify TempFile in trusted plugin." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
===================================================================
--- trunk/src/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc (revision 284789)
+++ trunk/src/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc (working copy)
@@ -338,7 +338,8 @@
BitcodeStreamDidFinish(PP_ERROR_FAILED);
return;
}
- temp_nexe_file_.reset(new TempFile(plugin_, handle));
+ *temp_nexe_file_->internal_handle() = handle;
+ // Open it for reading as the cached nexe file.
NexeReadDidOpen(temp_nexe_file_->Open(false));
}
@@ -346,10 +347,12 @@
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++) {
- PP_FileHandle obj_handle =
- plugin_->nacl_interface()->CreateTemporaryFile(plugin_->pp_instance());
- nacl::scoped_ptr<TempFile> temp_file(new TempFile(plugin_, obj_handle));
+ nacl::scoped_ptr<TempFile> temp_file(new TempFile(plugin_));
int32_t pp_error = temp_file->Open(true);
if (pp_error != PP_OK) {
ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP,
@@ -364,9 +367,6 @@
// 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));
}
« no previous file with comments | « no previous file | trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698