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

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

Issue 413493002: Pepper: Simplify TempFile in trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | 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: 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));
}
« no previous file with comments | « no previous file | ppapi/native_client/src/trusted/plugin/temporary_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698