| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ | 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ |
| 6 #define PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ | 6 #define PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ |
| 7 | 7 |
| 8 #ifdef _WIN32 | 8 #ifdef _WIN32 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
| 15 | 15 |
| 16 #ifdef _WIN32 | 16 #ifdef _WIN32 |
| 17 typedef HANDLE PP_FileHandle; | 17 typedef HANDLE PP_FileHandle; |
| 18 static const PP_FileHandle PP_kInvalidFileHandle = NULL; | 18 static const PP_FileHandle PP_kInvalidFileHandle = NULL; |
| 19 #else | 19 #else |
| 20 typedef int PP_FileHandle; | 20 typedef int PP_FileHandle; |
| 21 static const PP_FileHandle PP_kInvalidFileHandle = -1; | 21 static const PP_FileHandle PP_kInvalidFileHandle = -1; |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 struct PP_CompletionCallback; | 24 struct PP_CompletionCallback; |
| 25 struct PP_FontDescription_Dev; | 25 struct PP_FontDescription_Dev; |
| 26 struct PP_FileInfo_Dev; | 26 struct PP_FileInfo; |
| 27 | 27 |
| 28 struct PP_DirEntry_Dev { | 28 struct PP_DirEntry_Dev { |
| 29 const char* name; | 29 const char* name; |
| 30 PP_Bool is_dir; | 30 PP_Bool is_dir; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 struct PP_DirContents_Dev { | 33 struct PP_DirContents_Dev { |
| 34 int32_t count; | 34 int32_t count; |
| 35 struct PP_DirEntry_Dev* entries; | 35 struct PP_DirEntry_Dev* entries; |
| 36 }; | 36 }; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 PP_Bool recursive); | 80 PP_Bool recursive); |
| 81 | 81 |
| 82 // Creates a directory. The return value is the ppapi error, PP_OK if success, | 82 // Creates a directory. The return value is the ppapi error, PP_OK if success, |
| 83 // one of the PP_ERROR_* in case of failure. | 83 // one of the PP_ERROR_* in case of failure. |
| 84 int32_t (*CreateDir)(PP_Instance instance, const char* path); | 84 int32_t (*CreateDir)(PP_Instance instance, const char* path); |
| 85 | 85 |
| 86 // Queries information about a file. The return value is the ppapi error, | 86 // Queries information about a file. The return value is the ppapi error, |
| 87 // PP_OK if success, one of the PP_ERROR_* in case of failure. | 87 // PP_OK if success, one of the PP_ERROR_* in case of failure. |
| 88 int32_t (*QueryFile)(PP_Instance instance, | 88 int32_t (*QueryFile)(PP_Instance instance, |
| 89 const char* path, | 89 const char* path, |
| 90 struct PP_FileInfo_Dev* info); | 90 struct PP_FileInfo* info); |
| 91 | 91 |
| 92 // Gets the list of files contained in a directory. The return value is the | 92 // Gets the list of files contained in a directory. The return value is the |
| 93 // ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. If | 93 // ppapi error, PP_OK if success, one of the PP_ERROR_* in case of failure. If |
| 94 // non-NULL, the returned contents should be freed with FreeDirContents. | 94 // non-NULL, the returned contents should be freed with FreeDirContents. |
| 95 int32_t (*GetDirContents)(PP_Instance instance, | 95 int32_t (*GetDirContents)(PP_Instance instance, |
| 96 const char* path, | 96 const char* path, |
| 97 struct PP_DirContents_Dev** contents); | 97 struct PP_DirContents_Dev** contents); |
| 98 | 98 |
| 99 // Frees the data allocated by GetDirContents. | 99 // Frees the data allocated by GetDirContents. |
| 100 void (*FreeDirContents)(PP_Instance instance, | 100 void (*FreeDirContents)(PP_Instance instance, |
| 101 struct PP_DirContents_Dev* contents); | 101 struct PP_DirContents_Dev* contents); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // PPB_Flash_File_FileRef ------------------------------------------------------ | 104 // PPB_Flash_File_FileRef ------------------------------------------------------ |
| 105 | 105 |
| 106 #define PPB_FLASH_FILE_FILEREF_INTERFACE "PPB_Flash_File_FileRef;2" | 106 #define PPB_FLASH_FILE_FILEREF_INTERFACE "PPB_Flash_File_FileRef;2" |
| 107 | 107 |
| 108 // This interface provides (for Flash) synchronous access to files whose paths | 108 // This interface provides (for Flash) synchronous access to files whose paths |
| 109 // are given by a Pepper FileRef. Such FileRefs are typically obtained via the | 109 // are given by a Pepper FileRef. Such FileRefs are typically obtained via the |
| 110 // Pepper file chooser. | 110 // Pepper file chooser. |
| 111 struct PPB_Flash_File_FileRef { | 111 struct PPB_Flash_File_FileRef { |
| 112 // The functions below correspond exactly to their module-local counterparts | 112 // The functions below correspond exactly to their module-local counterparts |
| 113 // (except in taking FileRefs instead of paths, of course). We omit the | 113 // (except in taking FileRefs instead of paths, of course). We omit the |
| 114 // functionality which we do not provide for FileRefs. | 114 // functionality which we do not provide for FileRefs. |
| 115 int32_t (*OpenFile)(PP_Resource file_ref_id, | 115 int32_t (*OpenFile)(PP_Resource file_ref_id, |
| 116 int32_t mode, | 116 int32_t mode, |
| 117 PP_FileHandle* file); | 117 PP_FileHandle* file); |
| 118 int32_t (*QueryFile)(PP_Resource file_ref_id, | 118 int32_t (*QueryFile)(PP_Resource file_ref_id, |
| 119 struct PP_FileInfo_Dev* info); | 119 struct PP_FileInfo* info); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 #endif // PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ | 122 #endif // PPAPI_C_PRIVATE_PPB_FLASH_FILE_H_ |
| OLD | NEW |