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

Unified Diff: ppapi/c/private/ppb_flash_file.h

Issue 10534045: Add CreateTemporaryFile to PPB_Flash_File_ModuleLocal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/c/private/ppb_flash_file.h
diff --git a/ppapi/c/private/ppb_flash_file.h b/ppapi/c/private/ppb_flash_file.h
index ac8c0fb75df083c5eecaba727754eae2492a3e67..b9df0f51448d0173ed1c0380a0eee54d736a5c6a 100644
--- a/ppapi/c/private/ppb_flash_file.h
+++ b/ppapi/c/private/ppb_flash_file.h
@@ -34,13 +34,15 @@ struct PP_DirContents_Dev {
};
// PPB_Flash_File_ModuleLocal --------------------------------------------------
-
-#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE "PPB_Flash_File_ModuleLocal;2"
+#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE_2_0 "PPB_Flash_File_ModuleLocal;2"
+#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0 "PPB_Flash_File_ModuleLocal;3"
+#define PPB_FLASH_FILE_MODULELOCAL_INTERFACE \
+ PPB_FLASH_FILE_MODULELOCAL_INTERFACE_3_0
// This interface provides (for Flash) synchronous access to module-local files.
// Module-local file paths are '/'-separated UTF-8 strings, relative to a
// module-specific root.
-struct PPB_Flash_File_ModuleLocal {
+struct PPB_Flash_File_ModuleLocal_3_0 {
// Does initialization necessary for proxying this interface on background
// threads. You must always call this function before using any other
// function in this interface for a given instance ID.
@@ -97,8 +99,51 @@ struct PPB_Flash_File_ModuleLocal {
// Frees the data allocated by GetDirContents.
void (*FreeDirContents)(PP_Instance instance,
struct PP_DirContents_Dev* contents);
+
+ // Creates a temporary file in the directory specified by |dir_path|. The file
+ // will be automatically deleted when all handles to it are closed.
+ // Returns PP_OK if successful, one of the PP_ERROR_* values in case of
+ // failure.
+ //
+ // If successful, |file| is set to a file descriptor (posix) or a HANDLE
+ // (win32) to the file; |file_name_buffer| is set to the resulting file name
+ // (NULL-terminated). If failed, neither |file| nor |file_name_buffer| is
+ // touched.
+ // If |file_name_buffer| is too small to store the resulting file name plus
+ // the trailing NULL, the method fails and returns PP_ERROR_NOMEMORY.
+ int32_t (*CreateTemporaryFile)(PP_Instance instance,
viettrungluu 2012/06/07 20:17:36 Why don't we just add this to OpenFile()'s functio
yzshen1 2012/06/07 21:42:06 I considered adding this to OpenFile(), but I didn
+ const char* dir_path,
+ PP_FileHandle* file,
+ char* file_name_buffer,
+ uint32_t file_name_buffer_size);
+};
+
+struct PPB_Flash_File_ModuleLocal_2_0 {
+ bool (*CreateThreadAdapterForInstance)(PP_Instance instance);
+ void (*ClearThreadAdapterForInstance)(PP_Instance instance);
+ int32_t (*OpenFile)(PP_Instance instance,
+ const char* path,
+ int32_t mode,
+ PP_FileHandle* file);
+ int32_t (*RenameFile)(PP_Instance instance,
+ const char* path_from,
+ const char* path_to);
+ int32_t (*DeleteFileOrDir)(PP_Instance instance,
+ const char* path,
+ PP_Bool recursive);
+ int32_t (*CreateDir)(PP_Instance instance, const char* path);
+ int32_t (*QueryFile)(PP_Instance instance,
+ const char* path,
+ struct PP_FileInfo* info);
+ int32_t (*GetDirContents)(PP_Instance instance,
+ const char* path,
+ struct PP_DirContents_Dev** contents);
+ void (*FreeDirContents)(PP_Instance instance,
+ struct PP_DirContents_Dev* contents);
};
+typedef struct PPB_Flash_File_ModuleLocal_3_0 PPB_Flash_File_ModuleLocal;
+
// PPB_Flash_File_FileRef ------------------------------------------------------
#define PPB_FLASH_FILE_FILEREF_INTERFACE "PPB_Flash_File_FileRef;2"

Powered by Google App Engine
This is Rietveld 408576698