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

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

Issue 19717004: [NaCl SDK] Add nacl_io and sdk_util namespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad copyright in mount_mem 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 0a374c4078bb8d05e0ea4a155573cf037355b43e..73d403d0f33c5cad7aa9333aade30d30f4433481 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.h
@@ -17,10 +17,12 @@
#include "sdk_util/scoped_ref.h"
#include "sdk_util/simple_lock.h"
+namespace nacl_io {
+
// KernelHandle provides a reference counted container for the open
// file information, such as it's mount, node, access type and offset.
// KernelHandle can only be referenced when the KernelProxy lock is held.
-class KernelHandle : public RefObject {
+class KernelHandle : public sdk_util::RefObject {
public:
KernelHandle();
KernelHandle(const ScopedMount& mnt, const ScopedMountNode& node);
@@ -35,19 +37,21 @@ class KernelHandle : public RefObject {
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();
+ const ScopedMountNode& node() { return node_; }
+ const ScopedMount& mount() { return mount_; }
private:
- ScopedRef<MountNode> node_;
- ScopedRef<Mount> mount_;
- SimpleLock offs_lock_;
+ ScopedMountNode node_;
+ ScopedMount mount_;
+ sdk_util::SimpleLock offs_lock_;
size_t offs_;
friend class KernelProxy;
DISALLOW_COPY_AND_ASSIGN(KernelHandle);
};
-typedef ScopedRef<KernelHandle> ScopedKernelHandle;
+typedef sdk_util::ScopedRef<KernelHandle> ScopedKernelHandle;
+
+} // namespace nacl_io
#endif // LIBRARIES_NACL_IO_KERNEL_HANDLE_H_
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/inode_pool.h ('k') | native_client_sdk/src/libraries/nacl_io/kernel_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698