| 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_MOUNT_H_ | 5 #ifndef LIBRARIES_NACL_IO_MOUNT_H_ |
| 6 #define LIBRARIES_NACL_IO_MOUNT_H_ | 6 #define LIBRARIES_NACL_IO_MOUNT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "nacl_io/error.h" | 11 #include "nacl_io/error.h" |
| 12 #include "nacl_io/inode_pool.h" | 12 #include "nacl_io/inode_pool.h" |
| 13 #include "nacl_io/mount_node.h" | 13 #include "nacl_io/mount_node.h" |
| 14 #include "nacl_io/path.h" | 14 #include "nacl_io/path.h" |
| 15 | 15 |
| 16 #include "sdk_util/macros.h" | 16 #include "sdk_util/macros.h" |
| 17 #include "sdk_util/ref_object.h" | 17 #include "sdk_util/ref_object.h" |
| 18 #include "sdk_util/scoped_ref.h" | 18 #include "sdk_util/scoped_ref.h" |
| 19 | 19 |
| 20 namespace nacl_io { |
| 21 |
| 20 class Mount; | 22 class Mount; |
| 21 class MountNode; | 23 class MountNode; |
| 22 class PepperInterface; | 24 class PepperInterface; |
| 23 | 25 |
| 24 typedef ScopedRef<Mount> ScopedMount; | 26 typedef sdk_util::ScopedRef<Mount> ScopedMount; |
| 25 typedef std::map<std::string, std::string> StringMap_t; | 27 typedef std::map<std::string, std::string> StringMap_t; |
| 26 | 28 |
| 27 // NOTE: The KernelProxy is the only class that should be setting errno. All | 29 // NOTE: The KernelProxy is the only class that should be setting errno. All |
| 28 // other classes should return Error (as defined by nacl_io/error.h). | 30 // other classes should return Error (as defined by nacl_io/error.h). |
| 29 class Mount : public RefObject { | 31 class Mount : public sdk_util::RefObject { |
| 30 protected: | 32 protected: |
| 31 // The protected functions are only used internally and will not | 33 // The protected functions are only used internally and will not |
| 32 // acquire or release the mount's lock. | 34 // acquire or release the mount's lock. |
| 33 Mount(); | 35 Mount(); |
| 34 virtual ~Mount(); | 36 virtual ~Mount(); |
| 35 | 37 |
| 36 // Init must be called by the factory before the mount is used. | 38 // Init must be called by the factory before the mount is used. |
| 37 // This function must assign a root node, or replace FindNode. | 39 // This function must assign a root node, or replace FindNode. |
| 38 // |ppapi| can be NULL. If so, this mount cannot make any pepper calls. | 40 // |ppapi| can be NULL. If so, this mount cannot make any pepper calls. |
| 39 virtual Error Init(int dev, StringMap_t& args, PepperInterface* ppapi); | 41 virtual Error Init(int dev, StringMap_t& args, PepperInterface* ppapi); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 INodePool inode_pool_; | 85 INodePool inode_pool_; |
| 84 | 86 |
| 85 private: | 87 private: |
| 86 // May only be called by the KernelProxy when the Kernel's | 88 // May only be called by the KernelProxy when the Kernel's |
| 87 // lock is held, so we make it private. | 89 // lock is held, so we make it private. |
| 88 friend class KernelObject; | 90 friend class KernelObject; |
| 89 friend class KernelProxy; | 91 friend class KernelProxy; |
| 90 DISALLOW_COPY_AND_ASSIGN(Mount); | 92 DISALLOW_COPY_AND_ASSIGN(Mount); |
| 91 }; | 93 }; |
| 92 | 94 |
| 95 } // namespace nacl_io |
| 96 |
| 93 #endif // LIBRARIES_NACL_IO_MOUNT_H_ | 97 #endif // LIBRARIES_NACL_IO_MOUNT_H_ |
| OLD | NEW |