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

Side by Side Diff: native_client_sdk/src/libraries/nacl_mounts/mount_node_dir.h

Issue 9956156: Add mount sources for a MountNode (inode) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5
6 #ifndef LIBRARIES_NACL_MOUNTS_MOUNT_NODE_DIR_H_ 6 #ifndef LIBRARIES_NACL_MOUNTS_MOUNT_NODE_DIR_H_
7 #define LIBRARIES_NACL_MOUNTS_MOUNT_NODE_DIR_H_ 7 #define LIBRARIES_NACL_MOUNTS_MOUNT_NODE_DIR_H_
8 8
9 #include <dirent.h> 9 #include <dirent.h>
10 10
11 #include <map> 11 #include <map>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "mount_node.h" 15 #include "nacl_mounts/mount_node.h"
16 16
17 17
18 class MountNodeDir : public MountNode { 18 class MountNodeDir : public MountNode {
19 protected: 19 protected:
20 MountNodeDir(Mount *mount, int ino, int dev); 20 MountNodeDir(Mount *mount, int ino, int dev);
21 virtual ~MountNodeDir(); 21 virtual ~MountNodeDir();
22 virtual bool Init(int mode, short uid, short gid); 22 virtual bool Init(int mode, short uid, short gid);
23 23
24 public: 24 public:
25 typedef std::map<std::string, MountNode*> MountNodeMap_t; 25 typedef std::map<std::string, MountNode*> MountNodeMap_t;
26 26
27 virtual int GetDents(size_t offs, struct dirent* pdir, size_t count); 27 virtual int GetDents(size_t offs, struct dirent* pdir, size_t count);
28 virtual int Read(size_t offs, void *buf, size_t count); 28 virtual int Read(size_t offs, void *buf, size_t count);
29 virtual int Truncate(size_t size); 29 virtual int Truncate(size_t size);
30 virtual int Write(size_t offs, void *buf, size_t count); 30 virtual int Write(size_t offs, void *buf, size_t count);
31 31
32 // Adds a finds or adds a directory entry as an INO, updating the refcount 32 // Adds a finds or adds a directory entry as an INO, updating the refcount
33 virtual int AddChild(const std::string& name, MountNode *node); 33 virtual int AddChild(const std::string& name, MountNode *node);
34 virtual int RemoveChild(const std::string& name); 34 virtual int RemoveChild(const std::string& name);
35 virtual MountNode* FindChild(const std::string& name); 35 virtual MountNode* FindChild(const std::string& name);
36 virtual int ChildCount();
36 37
37 38
38 protected: 39 protected:
39 void ClearCache(); 40 void ClearCache();
40 void BuildCache(); 41 void BuildCache();
41 42
42 private: 43 private:
43 struct dirent* cache_; 44 struct dirent* cache_;
44 MountNodeMap_t map_; 45 MountNodeMap_t map_;
45 friend class Mount; 46
47 friend class MountMem;
46 }; 48 };
47 49
48 #endif // LIBRARIES_NACL_MOUNTS_MOUNT_NODE_DIR_H_ 50 #endif // LIBRARIES_NACL_MOUNTS_MOUNT_NODE_DIR_H_
49 51
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698