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

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

Issue 16232016: [NaCl SDK] nacl_io: big refactor to return error value (errno). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge master, fix windows Created 7 years, 6 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_object.h
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_object.h b/native_client_sdk/src/libraries/nacl_io/kernel_object.h
index 97b197f80513b07d9644bda8a9301d88781a0d50..eb4c8ac0412477bfb75a4c36dad19740a63edc66 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_object.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_object.h
@@ -11,6 +11,7 @@
#include <string>
#include <vector>
+#include "nacl_io/error.h"
#include "nacl_io/path.h"
class KernelHandle;
@@ -28,17 +29,25 @@ class KernelObject {
KernelObject();
virtual ~KernelObject();
- // Find the mount for the given path, and acquires it
- Mount* AcquireMountAndPath(const std::string& relpath, Path *pobj);
+ // Find the mount for the given path, and acquires it.
+ // Assumes |out_mount| and |out_path| are non-NULL.
+ Error AcquireMountAndPath(const std::string& relpath,
+ Mount** out_mount,
+ Path* out_path);
+ // Assumes |mnt| is non-NULL.
void ReleaseMount(Mount* mnt);
// Convert from FD to KernelHandle, and acquire the handle.
- KernelHandle* AcquireHandle(int fd);
+ // Assumes |out_handle| is non-NULL.
+ Error AcquireHandle(int fd, KernelHandle** out_handle);
+ // Assumes |handle| is non-NULL.
void ReleaseHandle(KernelHandle* handle);
// Allocate a new fd and assign the handle to it, while
// ref counting the handle and associated mount.
+ // Assumes |handle| is non-NULL;
int AllocateFD(KernelHandle* handle);
+ // Assumes |handle| is non-NULL;
void FreeAndReassignFD(int fd, KernelHandle* handle);
void FreeFD(int fd);
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_handle.cc ('k') | native_client_sdk/src/libraries/nacl_io/kernel_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698