| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LIBRARIES_NACL_IO_KERNEL_OBJECT_H_ | 5 #ifndef LIBRARIES_NACL_IO_KERNEL_OBJECT_H_ |
| 6 #define LIBRARIES_NACL_IO_KERNEL_OBJECT_H_ | 6 #define LIBRARIES_NACL_IO_KERNEL_OBJECT_H_ |
| 7 | 7 |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 typedef std::vector<Descriptor_t> HandleMap_t; | 42 typedef std::vector<Descriptor_t> HandleMap_t; |
| 43 typedef std::map<std::string, ScopedFilesystem> FsMap_t; | 43 typedef std::map<std::string, ScopedFilesystem> FsMap_t; |
| 44 | 44 |
| 45 KernelObject(); | 45 KernelObject(); |
| 46 virtual ~KernelObject(); | 46 virtual ~KernelObject(); |
| 47 | 47 |
| 48 // Attach the given Filesystem object at the specified path. | 48 // Attach the given Filesystem object at the specified path. |
| 49 Error AttachFsAtPath(const ScopedFilesystem& fs, const std::string& path); | 49 Error AttachFsAtPath(const ScopedFilesystem& fs, const std::string& path); |
| 50 | 50 |
| 51 // Unmap the Filesystem object from the specified path and release it. | 51 // Unmap the Filesystem object from the specified path and release it. |
| 52 Error DetachFsAtPath(const std::string& path); | 52 Error DetachFsAtPath(const std::string& path, ScopedFilesystem* out_fs); |
| 53 | 53 |
| 54 // Find the filesystem for the given path, and acquires it and return a | 54 // Find the filesystem for the given path, and acquires it and return a |
| 55 // path relative to the filesystem. | 55 // path relative to the filesystem. |
| 56 // Assumes |out_fs| and |rel_path| are non-NULL. | 56 // Assumes |out_fs| and |rel_path| are non-NULL. |
| 57 Error AcquireFsAndRelPath(const std::string& path, | 57 Error AcquireFsAndRelPath(const std::string& path, |
| 58 ScopedFilesystem* out_fs, | 58 ScopedFilesystem* out_fs, |
| 59 Path* rel_path); | 59 Path* rel_path); |
| 60 | 60 |
| 61 // Find the filesystem and node for the given path, acquiring/creating it as | 61 // Find the filesystem and node for the given path, acquiring/creating it as |
| 62 // specified by the |oflags|. | 62 // specified by the |oflags|. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Lock to protect cwd_. | 110 // Lock to protect cwd_. |
| 111 sdk_util::SimpleLock cwd_lock_; | 111 sdk_util::SimpleLock cwd_lock_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(KernelObject); | 113 DISALLOW_COPY_AND_ASSIGN(KernelObject); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace nacl_io | 116 } // namespace nacl_io |
| 117 | 117 |
| 118 #endif // LIBRARIES_NACL_IO_KERNEL_OBJECT_H_ | 118 #endif // LIBRARIES_NACL_IO_KERNEL_OBJECT_H_ |
| OLD | NEW |