Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/kernel_handle.h |
| diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h |
| index 64ef8abd15f3254ef72655b43eda35b9d041d6f4..892f3f5bbebd81b46a243084569b19335b4d9297 100644 |
| --- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h |
| +++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h |
| @@ -15,6 +15,7 @@ |
| #include "sdk_util/macros.h" |
| #include "sdk_util/ref_object.h" |
| #include "sdk_util/scoped_ref.h" |
| +#include "sdk_util/simple_lock.h" |
| // KernelHandle provides a reference counted container for the open |
| // file information, such as it's mount, node, access type and offset. |
| @@ -29,11 +30,20 @@ class KernelHandle : public RefObject { |
| // Assumes |out_offset| is non-NULL. |
| Error Seek(off_t offset, int whence, off_t* out_offset); |
| - ScopedRef<Mount> mount_; |
| + // Distatches Read, Write, GetDents to atomically update offs_. |
|
binji
2013/07/13 00:16:48
sp: Dispatches?
|
| + Error Read(void* buf, size_t nbytes, int* bytes_read); |
| + Error Write(const void* buf, size_t nbytes, int* bytes_written); |
| + Error GetDents(struct dirent* pdir, size_t count, int* bytes_written); |
| + |
| + const ScopedRef<MountNode>& node(); |
| + const ScopedRef<Mount>& mount(); |
| + |
| +private: |
| ScopedRef<MountNode> node_; |
| + ScopedRef<Mount> mount_; |
| + SimpleLock offs_lock_; |
| size_t offs_; |
| - private: |
| friend class KernelProxy; |
| DISALLOW_COPY_AND_ASSIGN(KernelHandle); |
| }; |