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

Unified Diff: ppapi/native_client/src/trusted/plugin/temporary_file.h

Issue 299143004: Pepper: TempFile cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Saner fd behavior Created 6 years, 7 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
Index: ppapi/native_client/src/trusted/plugin/temporary_file.h
diff --git a/ppapi/native_client/src/trusted/plugin/temporary_file.h b/ppapi/native_client/src/trusted/plugin/temporary_file.h
index fcfc7df4ad7eeba508463613653d6aa60b413598..4bc8f7140e389054d1d6e7d84408c0a5e342acbb 100644
--- a/ppapi/native_client/src/trusted/plugin/temporary_file.h
+++ b/ppapi/native_client/src/trusted/plugin/temporary_file.h
@@ -9,7 +9,6 @@
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
#include "ppapi/c/private/pp_file_handle.h"
-#include "ppapi/cpp/completion_callback.h"
namespace plugin {
@@ -43,7 +42,7 @@ class TempFile {
// Opens a temporary file object and descriptor wrapper referring to the file.
// If |writeable| is true, the descriptor will be opened for writing, and
// write_wrapper will return a valid pointer, otherwise it will return NULL.
- void Open(const pp::CompletionCallback& cb, bool writeable);
+ int32_t Open(bool writeable);
// Resets file position of the handle, for reuse.
bool Reset();
@@ -51,11 +50,13 @@ class TempFile {
// The nacl::DescWrapper* for the writeable version of the file.
nacl::DescWrapper* write_wrapper() { return write_wrapper_.get(); }
nacl::DescWrapper* read_wrapper() { return read_wrapper_.get(); }
- nacl::DescWrapper* release_read_wrapper() {
- return read_wrapper_.release();
- }
- PP_FileHandle* existing_handle() { return &existing_handle_; }
+ // Returns the handle to the file repesented and resets the internal handle
+ // and all wrappers.
+ PP_FileHandle TakeFileHandle();
+
+ // Used by GetNexeFd() to set the underlying internal handle.
+ PP_FileHandle* internal_handle() { return &internal_handle_; }
private:
NACL_DISALLOW_COPY_AND_ASSIGN(TempFile);
@@ -63,7 +64,7 @@ class TempFile {
Plugin* plugin_;
nacl::scoped_ptr<nacl::DescWrapper> read_wrapper_;
nacl::scoped_ptr<nacl::DescWrapper> write_wrapper_;
- PP_FileHandle existing_handle_;
+ PP_FileHandle internal_handle_;
};
} // namespace plugin
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc ('k') | ppapi/native_client/src/trusted/plugin/temporary_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698