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

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

Issue 99203014: [NaCl SDK] Map active fds to absolute paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Conform to style guide Created 6 years, 11 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
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/kernel_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70ffb2f54a13e80900067f0b1845e8348be2f591..ca6be9d4e57e136d13742a609d77372d4c7c5e09 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_object.h
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_object.h
@@ -31,10 +31,13 @@ class KernelObject {
public:
struct Descriptor_t {
Descriptor_t() : flags(0) {}
- explicit Descriptor_t(const ScopedKernelHandle& h) : handle(h), flags(0) {}
+ explicit Descriptor_t(const ScopedKernelHandle& h,
+ const std::string& open_path)
+ : handle(h), flags(0), path(open_path) {}
ScopedKernelHandle handle;
int flags;
+ std::string path;
};
typedef std::vector<Descriptor_t> HandleMap_t;
typedef std::map<std::string, ScopedFilesystem> FsMap_t;
@@ -71,14 +74,18 @@ class KernelObject {
// Convert from FD to KernelHandle, and acquire the handle.
// Assumes |out_handle| is non-NULL.
Error AcquireHandle(int fd, ScopedKernelHandle* out_handle);
+ Error AcquireHandleAndPath(int fd, ScopedKernelHandle *out_handle,
+ std::string* out_path);
// Allocate a new fd and assign the handle to it, while
// ref counting the handle and associated filesystem.
// Assumes |handle| is non-NULL;
- int AllocateFD(const ScopedKernelHandle& handle);
+ int AllocateFD(const ScopedKernelHandle& handle,
+ const std::string& path=std::string());
// Assumes |handle| is non-NULL;
- void FreeAndReassignFD(int fd, const ScopedKernelHandle& handle);
+ void FreeAndReassignFD(int fd, const ScopedKernelHandle& handle,
+ const std::string& path);
void FreeFD(int fd);
// Returns or sets CWD
« no previous file with comments | « no previous file | 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