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

Unified Diff: trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.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 | « trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.h ('k') | no next file » | 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/temporary_file.cc
===================================================================
--- trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.cc (revision 284789)
+++ trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.cc (working copy)
@@ -18,13 +18,21 @@
namespace plugin {
-TempFile::TempFile(Plugin* plugin, PP_FileHandle handle)
- : plugin_(plugin), internal_handle_(handle) { }
+TempFile::TempFile(Plugin* plugin) : plugin_(plugin),
+ internal_handle_(PP_kInvalidFileHandle) {
+}
TempFile::~TempFile() { }
int32_t TempFile::Open(bool writeable) {
+ // TODO(teravest): Clean up this Open() behavior; this is really confusing as
+ // written.
if (internal_handle_ == PP_kInvalidFileHandle) {
+ internal_handle_ =
+ plugin_->nacl_interface()->CreateTemporaryFile(plugin_->pp_instance());
+ }
+
+ if (internal_handle_ == PP_kInvalidFileHandle) {
PLUGIN_PRINTF(("TempFile::Open failed w/ PP_kInvalidFileHandle\n"));
return PP_ERROR_FAILED;
}
« no previous file with comments | « trunk/src/ppapi/native_client/src/trusted/plugin/temporary_file.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698