| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2010 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 /* | |
| 8 * Subclass of the gio object for use in trusted code. Provides write | |
| 9 * buffering into a shared memory object that may grow as needed. | |
| 10 */ | |
| 11 | |
| 12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_GIO_WRAPPED_DESC_GIO_SHM_UNBOUNDED_H_ | |
| 13 #define NATIVE_CLIENT_SRC_TRUSTED_GIO_WRAPPED_DESC_GIO_SHM_UNBOUNDED_H_ | |
| 14 | |
| 15 #include "native_client/src/include/nacl_base.h" | |
| 16 | |
| 17 #include "native_client/src/shared/gio/gio.h" | |
| 18 | |
| 19 #include "native_client/src/trusted/gio/gio_shm.h" | |
| 20 | |
| 21 EXTERN_C_BEGIN | |
| 22 | |
| 23 struct NaClGioShm; | |
| 24 | |
| 25 struct NaClGioShmUnbounded { | |
| 26 /* public */ | |
| 27 struct Gio base; | |
| 28 struct NaClGioShm *ngsp; | |
| 29 | |
| 30 /* private */ | |
| 31 size_t shm_avail_sz; | |
| 32 size_t shm_written; | |
| 33 size_t io_offset; /* deal with seeks */ | |
| 34 }; | |
| 35 | |
| 36 | |
| 37 /* | |
| 38 * When the NaClGioShmUnbounded buffer writes are all done, | |
| 39 * NaClGioShmUnboundedGetNaClDesc is used to obtain the NaClDesc | |
| 40 * pointer -- caller is responsible for taking another reference with | |
| 41 * NaClDescRef, if the lifetime must extend beyond that of the | |
| 42 * NaClGioShmUnbounded object -- and the actual size. Actual size is | |
| 43 * the largest offset written, not number of bytes written, due to | |
| 44 * Seek and the potential of overlapping Writes (or gaps). | |
| 45 */ | |
| 46 struct NaClDesc *NaClGioShmUnboundedGetNaClDesc( | |
| 47 struct NaClGioShmUnbounded *self, | |
| 48 size_t *written); | |
| 49 | |
| 50 | |
| 51 int NaClGioShmUnboundedCtor(struct NaClGioShmUnbounded *self); | |
| 52 | |
| 53 | |
| 54 EXTERN_C_END | |
| 55 | |
| 56 #endif /* NATIVE_CLIENT_SRC_TRUSTED_GIO_WRAPPED_DESC_GIO_SHM_UNBOUNDED_H_ */ | |
| OLD | NEW |