Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This file defines the API to create a file i/o object. | 8 * This file defines the API to create a file i/o object. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 [generate_thunk] | 11 [generate_thunk] |
| 12 | 12 |
| 13 label Chrome { | 13 label Chrome { |
| 14 M14 = 1.0, | 14 M14 = 1.0, |
| 15 M25 = 1.1 | 15 M25 = 1.1, |
| 16 M29 = 1.2 | |
| 16 }; | 17 }; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * The PP_FileOpenFlags enum contains file open constants. | 20 * The PP_FileOpenFlags enum contains file open constants. |
| 20 */ | 21 */ |
| 21 [assert_size(4)] | 22 [assert_size(4)] |
| 22 enum PP_FileOpenFlags { | 23 enum PP_FileOpenFlags { |
| 23 /** Requests read access to a file. */ | 24 /** Requests read access to a file. */ |
| 24 PP_FILEOPENFLAG_READ = 1 << 0, | 25 PP_FILEOPENFLAG_READ = 1 << 0, |
| 25 | 26 |
| 26 /** | 27 /** |
| 27 * Requests write access to a file. May be combined with | 28 * Requests write access to a file. May be combined with |
| 28 * <code>PP_FILEOPENFLAG_READ</code> to request read and write access. | 29 * <code>PP_FILEOPENFLAG_READ</code> to request read and write access. |
| 29 */ | 30 */ |
| 30 PP_FILEOPENFLAG_WRITE = 1 << 1, | 31 PP_FILEOPENFLAG_WRITE = 1 << 1, |
| 31 | 32 |
| 32 /** | 33 /** |
| 33 * Requests that the file be created if it does not exist. If the file | 34 * Requests that the file be created if it does not exist. If the file |
| 34 * already exists, then this flag is ignored unless | 35 * already exists, then this flag is ignored unless |
| 35 * <code>PP_FILEOPENFLAG_EXCLUSIVE</code> was also specified, in which case | 36 * <code>PP_FILEOPENFLAG_EXCLUSIVE</code> was also specified, in which case |
| 36 * FileIO::Open() will fail. | 37 * FileIO::Open() will fail. |
| 37 */ | 38 */ |
| 38 PP_FILEOPENFLAG_CREATE = 1 << 2, | 39 PP_FILEOPENFLAG_CREATE = 1 << 2, |
| 39 | 40 |
| 40 /** | 41 /** |
| 41 * Requests that the file be truncated to length 0 if it exists and is a | 42 * Requests that the file be truncated to length 0 if it exists and is a |
| 42 * regular file. <code>PP_FILEOPENFLAG_WRITE</code> must also be specified. | 43 * regular file. <code>PP_FILEOPENFLAG_WRITE</code> must also be specified. |
| 43 */ | 44 */ |
| 44 PP_FILEOPENFLAG_TRUNCATE = 1 << 3, | 45 PP_FILEOPENFLAG_TRUNCATE = 1 << 3, |
| 45 | 46 |
| 46 /** | 47 /** |
| 47 * Requests that the file is created when this flag is combined with | 48 * Requests that the file is created when this flag is combined with |
| 48 * <code>PP_FILEOPENFLAG_CREATE</code>. If this flag is specified, and the | 49 * <code>PP_FILEOPENFLAG_CREATE</code>. If this flag is specified, and the |
| 49 * file already exists, then the FileIO::Open() call will fail. | 50 * file already exists, then the FileIO::Open() call will fail. |
| 50 */ | 51 */ |
| 51 PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4 | 52 PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4, |
| 53 | |
| 54 /** | |
| 55 * Requests write access to a file, but writes will always occur at the end of | |
| 56 * the file. Mututally exclusive with <code>PP_FILEOPENFLAG_WRITE</code>. | |
| 57 * | |
| 58 * This is only supported in version 1.2 (M29) and later. | |
|
dmichael (off chromium)
2013/06/11 21:18:29
M29 probably doesn't mean anything to most plugin
| |
| 59 */ | |
| 60 [version=1.2] | |
| 61 PP_FILEOPENFLAG_APPEND = 1 << 5 | |
| 52 }; | 62 }; |
| 53 | 63 |
| 54 | 64 |
| 55 /** | 65 /** |
| 56 * The <code>PPB_FileIO</code> struct is used to operate on a regular file | 66 * The <code>PPB_FileIO</code> struct is used to operate on a regular file |
| 57 * (PP_FileType_Regular). | 67 * (PP_FileType_Regular). |
| 58 */ | 68 */ |
| 59 interface PPB_FileIO { | 69 interface PPB_FileIO { |
| 60 /** | 70 /** |
| 61 * Create() creates a new FileIO object. | 71 * Create() creates a new FileIO object. |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 * cannot be interleaved with other operations. | 278 * cannot be interleaved with other operations. |
| 269 */ | 279 */ |
| 270 [version = 1.1] | 280 [version = 1.1] |
| 271 int32_t ReadToArray([in] PP_Resource file_io, | 281 int32_t ReadToArray([in] PP_Resource file_io, |
| 272 [in] int64_t offset, | 282 [in] int64_t offset, |
| 273 [in] int32_t max_read_length, | 283 [in] int32_t max_read_length, |
| 274 [inout] PP_ArrayOutput output, | 284 [inout] PP_ArrayOutput output, |
| 275 [in] PP_CompletionCallback callback); | 285 [in] PP_CompletionCallback callback); |
| 276 }; | 286 }; |
| 277 | 287 |
| OLD | NEW |