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 |
dmichael (off chromium)
2013/06/11 20:02:22
I think we should update to 1.2 so that a consumer
| |
16 }; | 16 }; |
17 | 17 |
18 /** | 18 /** |
19 * The PP_FileOpenFlags enum contains file open constants. | 19 * The PP_FileOpenFlags enum contains file open constants. |
20 */ | 20 */ |
21 [assert_size(4)] | 21 [assert_size(4)] |
22 enum PP_FileOpenFlags { | 22 enum PP_FileOpenFlags { |
23 /** Requests read access to a file. */ | 23 /** Requests read access to a file. */ |
24 PP_FILEOPENFLAG_READ = 1 << 0, | 24 PP_FILEOPENFLAG_READ = 1 << 0, |
25 | 25 |
26 /** | 26 /** |
27 * Requests write access to a file. May be combined with | 27 * Requests write access to a file. May be combined with |
28 * <code>PP_FILEOPENFLAG_READ</code> to request read and write access. | 28 * <code>PP_FILEOPENFLAG_READ</code> to request read and write access. |
29 */ | 29 */ |
30 PP_FILEOPENFLAG_WRITE = 1 << 1, | 30 PP_FILEOPENFLAG_WRITE = 1 << 1, |
31 | 31 |
32 /** | 32 /** |
33 * Requests that the file be created if it does not exist. If the file | 33 * Requests that the file be created if it does not exist. If the file |
34 * already exists, then this flag is ignored unless | 34 * already exists, then this flag is ignored unless |
35 * <code>PP_FILEOPENFLAG_EXCLUSIVE</code> was also specified, in which case | 35 * <code>PP_FILEOPENFLAG_EXCLUSIVE</code> was also specified, in which case |
36 * FileIO::Open() will fail. | 36 * FileIO::Open() will fail. |
37 */ | 37 */ |
38 PP_FILEOPENFLAG_CREATE = 1 << 2, | 38 PP_FILEOPENFLAG_CREATE = 1 << 2, |
39 | 39 |
40 /** | 40 /** |
41 * Requests that the file be truncated to length 0 if it exists and is a | 41 * 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. | 42 * regular file. <code>PP_FILEOPENFLAG_WRITE</code> must also be specified. |
43 */ | 43 */ |
44 PP_FILEOPENFLAG_TRUNCATE = 1 << 3, | 44 PP_FILEOPENFLAG_TRUNCATE = 1 << 3, |
45 | 45 |
46 /** | 46 /** |
47 * Requests that the file is created when this flag is combined with | 47 * 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 | 48 * <code>PP_FILEOPENFLAG_CREATE</code>. If this flag is specified, and the |
49 * file already exists, then the FileIO::Open() call will fail. | 49 * file already exists, then the FileIO::Open() call will fail. |
50 */ | 50 */ |
51 PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4 | 51 PP_FILEOPENFLAG_EXCLUSIVE = 1 << 4, |
52 | |
53 /** | |
54 * Requests write access to a file, but writes will always occur at the end of | |
55 * the file. Mututally exclusive with <code>PP_FILEOPENFLAG_WRITE</code>. | |
56 */ | |
dmichael (off chromium)
2013/06/11 20:02:22
I think it would be good to comment that this is o
| |
57 PP_FILEOPENFLAG_APPEND = 1 << 5 | |
52 }; | 58 }; |
53 | 59 |
54 | 60 |
55 /** | 61 /** |
56 * The <code>PPB_FileIO</code> struct is used to operate on a regular file | 62 * The <code>PPB_FileIO</code> struct is used to operate on a regular file |
57 * (PP_FileType_Regular). | 63 * (PP_FileType_Regular). |
58 */ | 64 */ |
59 interface PPB_FileIO { | 65 interface PPB_FileIO { |
60 /** | 66 /** |
61 * Create() creates a new FileIO object. | 67 * 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. | 274 * cannot be interleaved with other operations. |
269 */ | 275 */ |
270 [version = 1.1] | 276 [version = 1.1] |
271 int32_t ReadToArray([in] PP_Resource file_io, | 277 int32_t ReadToArray([in] PP_Resource file_io, |
272 [in] int64_t offset, | 278 [in] int64_t offset, |
273 [in] int32_t max_read_length, | 279 [in] int32_t max_read_length, |
274 [inout] PP_ArrayOutput output, | 280 [inout] PP_ArrayOutput output, |
275 [in] PP_CompletionCallback callback); | 281 [in] PP_CompletionCallback callback); |
276 }; | 282 }; |
277 | 283 |
OLD | NEW |