Chromium Code Reviews| 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_PPB_FILE_IO_TRUSTED_H_ | |
| 6 #define PPAPI_C_PPB_FILE_IO_TRUSTED_H_ | |
| 7 | 5 |
| 6 /* From trusted/ppb_file_io_trusted.idl modified Fri Jul 15 14:07:23 2011. */ | |
| 7 | |
| 8 #ifndef PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_ | |
| 9 #define PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_ | |
| 10 | |
| 11 #include "ppapi/c/pp_completion_callback.h" | |
| 12 #include "ppapi/c/pp_macros.h" | |
| 8 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
| 9 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
| 10 | 15 |
| 11 struct PP_CompletionCallback; | 16 /** |
| 17 * @file | |
| 18 * | |
| 19 * This file defines the trusted file IO interface | |
| 20 */ | |
| 12 | 21 |
| 22 | |
| 23 /** | |
| 24 * @addtogroup Interfaces | |
| 25 * @{ | |
| 26 */ | |
| 27 /* Available only to trusted implementations. */ | |
| 13 #define PPB_FILEIOTRUSTED_INTERFACE_0_4 "PPB_FileIOTrusted;0.4" | 28 #define PPB_FILEIOTRUSTED_INTERFACE_0_4 "PPB_FileIOTrusted;0.4" |
| 14 #define PPB_FILEIOTRUSTED_INTERFACE PPB_FILEIOTRUSTED_INTERFACE_0_4 | 29 #define PPB_FILEIOTRUSTED_INTERFACE PPB_FILEIOTRUSTED_INTERFACE_0_4 |
| 15 | 30 |
| 16 // Available only to trusted implementations. | |
| 17 struct PPB_FileIOTrusted { | 31 struct PPB_FileIOTrusted { |
| 18 // Returns a file descriptor corresponding to the given FileIO object. On | 32 /** |
| 19 // Windows, returns a HANDLE; on all other platforms, returns a POSIX file | 33 * Returns a file descriptor corresponding to the given FileIO object. On |
| 20 // descriptor. The FileIO object must have been opened with a successful | 34 * Windows, returns a HANDLE; on all other platforms, returns a POSIX file |
| 21 // call to FileIO::Open. The file descriptor will be closed automatically | 35 * descriptor. The FileIO object must have been opened with a successful |
| 22 // when the FileIO object is closed or destroyed. | 36 * call to FileIO::Open. The file descriptor will be closed automatically |
| 37 * when the FileIO object is closed or destroyed. | |
| 38 */ | |
| 23 int32_t (*GetOSFileDescriptor)(PP_Resource file_io); | 39 int32_t (*GetOSFileDescriptor)(PP_Resource file_io); |
| 24 | 40 |
| 25 // Notifies the browser that underlying file will be modified. This gives | 41 /* Notifies the browser that underlying file will be modified. This gives */ |
| 26 // the browser the opportunity to apply quota restrictions and possibly | 42 /* the browser the opportunity to apply quota restrictions and possibly */ |
| 27 // return an error to indicate that the write is not allowed. | 43 /* return an error to indicate that the write is not allowed. */ |
|
dmichael (off chromium)
2011/07/17 02:00:10
Why is this a different style?
noelallen1
2011/07/18 17:51:56
We have a mix of //, /*, and /** comments in the o
| |
| 28 int32_t (*WillWrite)(PP_Resource file_io, | 44 int32_t (*WillWrite)(PP_Resource file_io, |
| 29 int64_t offset, | 45 int64_t offset, |
| 30 int32_t bytes_to_write, | 46 int32_t bytes_to_write, |
| 31 struct PP_CompletionCallback callback); | 47 struct PP_CompletionCallback callback); |
| 32 | 48 |
| 33 // Notifies the browser that underlying file will be modified. This gives | 49 /** |
| 34 // the browser the opportunity to apply quota restrictions and possibly | 50 * Notifies the browser that underlying file will be modified. This gives |
| 35 // return an error to indicate that the write is not allowed. | 51 * the browser the opportunity to apply quota restrictions and possibly |
| 52 * return an error to indicate that the write is not allowed. | |
| 53 * | |
| 54 * TODO(darin): Maybe unify the above into a single WillChangeFileSize | |
| 55 * method? The above methods have the advantage of mapping to PPB_FileIO | |
| 56 * Write and SetLength calls. WillChangeFileSize would require the caller to | |
| 57 * compute the file size resulting from a Write call, which may be | |
| 58 * undesirable. | |
| 59 */ | |
| 36 int32_t (*WillSetLength)(PP_Resource file_io, | 60 int32_t (*WillSetLength)(PP_Resource file_io, |
| 37 int64_t length, | 61 int64_t length, |
| 38 struct PP_CompletionCallback callback); | 62 struct PP_CompletionCallback callback); |
| 39 | 63 |
| 40 // TODO(darin): Maybe unify the above into a single WillChangeFileSize | |
| 41 // method? The above methods have the advantage of mapping to PPB_FileIO | |
| 42 // Write and SetLength calls. WillChangeFileSize would require the caller to | |
| 43 // compute the file size resulting from a Write call, which may be | |
| 44 // undesirable. | |
| 45 }; | 64 }; |
| 46 | 65 |
| 47 #endif /* PPAPI_C_PPB_FILE_IO_TRUSTED_H_ */ | 66 /** |
| 67 * @} | |
| 68 */ | |
| 48 | 69 |
| 70 #endif /* PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_ */ | |
| 71 | |
| OLD | NEW |