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

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

Issue 12166002: Cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 #ifndef LIBRARIES_NACL_MOUNTS_MOUNT_NODE_H_ 5 #ifndef LIBRARIES_NACL_MOUNTS_MOUNT_NODE_H_
6 #define LIBRARIES_NACL_MOUNTS_MOUNT_NODE_H_ 6 #define LIBRARIES_NACL_MOUNTS_MOUNT_NODE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "nacl_mounts/osstat.h" 10 #include "nacl_mounts/osstat.h"
11 #include "utils/ref_object.h" 11 #include "utils/ref_object.h"
12 12
13 struct dirent; 13 struct dirent;
14 struct stat; 14 struct stat;
15 class Mount; 15 class Mount;
16 16
17 class MountNode : public RefObject { 17 class MountNode : public RefObject {
18 protected: 18 protected:
19 MountNode(Mount* mount);
19 virtual ~MountNode(); 20 virtual ~MountNode();
20 21
21 // This method is called by Destroy when the last reference to this
22 // MountNode is released. Override this instead of Destroy, but do not call
23 // it directly.
24 virtual int Close();
25
26 protected: 22 protected:
27 MountNode(Mount* mount, int ino, int dev); 23 virtual bool Init(int perm);
28 virtual bool Init(int mode, short uid, short gid);
29 virtual void Destroy(); 24 virtual void Destroy();
30 25
31 public: 26 public:
32 // Normal OS operations on a node (file), can be called by the kernel 27 // Normal OS operations on a node (file), can be called by the kernel
33 // directly so it must lock and unlock appropriately. These functions 28 // directly so it must lock and unlock appropriately. These functions
34 // must not be called by the mount. 29 // must not be called by the mount.
35 virtual int FSync(); 30 virtual int FSync();
36 virtual int GetDents(size_t offs, struct dirent* pdir, size_t count); 31 virtual int GetDents(size_t offs, struct dirent* pdir, size_t count);
37 virtual int GetStat(struct stat* stat); 32 virtual int GetStat(struct stat* stat);
38 virtual int Ioctl(int request, char* arg); 33 virtual int Ioctl(int request, char* arg);
(...skipping 22 matching lines...) Expand all
61 virtual int ChildCount(); 56 virtual int ChildCount();
62 57
63 // Update the link count 58 // Update the link count
64 virtual void Link(); 59 virtual void Link();
65 virtual void Unlink(); 60 virtual void Unlink();
66 61
67 protected: 62 protected:
68 struct stat stat_; 63 struct stat stat_;
69 Mount* mount_; 64 Mount* mount_;
70 65
66 friend class Mount;
71 friend class MountDev; 67 friend class MountDev;
72 friend class MountHtml5Fs; 68 friend class MountHtml5Fs;
73 friend class MountHttp; 69 friend class MountHttp;
74 friend class MountMem; 70 friend class MountMem;
75 friend class MountNodeDir; 71 friend class MountNodeDir;
76 }; 72 };
77 73
78 #endif // LIBRARIES_NACL_MOUNTS_MOUNT_NODE_H_ 74 #endif // LIBRARIES_NACL_MOUNTS_MOUNT_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698