Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_handle.h

Issue 18644009: [NaCl SDK] Upate atomic ops in nacl_io (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'Move comment to correct location' Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698