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

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

Issue 18644009: [NaCl SDK] Upate atomic ops in nacl_io (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add declartions for newval and oldval Created 7 years, 5 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_IO_MOUNT_NODE_H_ 5 #ifndef LIBRARIES_NACL_IO_MOUNT_NODE_H_
6 #define LIBRARIES_NACL_IO_MOUNT_NODE_H_ 6 #define LIBRARIES_NACL_IO_MOUNT_NODE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "nacl_io/error.h" 10 #include "nacl_io/error.h"
11 #include "nacl_io/osstat.h" 11 #include "nacl_io/osstat.h"
12 12
13 #include "sdk_util/ref_object.h" 13 #include "sdk_util/ref_object.h"
14 #include "sdk_util/scoped_ref.h" 14 #include "sdk_util/scoped_ref.h"
15 #include "sdk_util/simple_lock.h"
15 16
16 struct dirent; 17 struct dirent;
17 struct stat; 18 struct stat;
18 19
19 class Mount; 20 class Mount;
20 class MountNode; 21 class MountNode;
21 22
22 typedef ScopedRef<MountNode> ScopedMountNode; 23 typedef ScopedRef<MountNode> ScopedMountNode;
23 24
24 // NOTE: The KernelProxy is the only class that should be setting errno. All 25 // NOTE: The KernelProxy is the only class that should be setting errno. All
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Find a child and return it without updating the refcount 90 // Find a child and return it without updating the refcount
90 // Assumes that |out_node| is non-NULL. 91 // Assumes that |out_node| is non-NULL.
91 virtual Error FindChild(const std::string& name, ScopedMountNode* out_node); 92 virtual Error FindChild(const std::string& name, ScopedMountNode* out_node);
92 93
93 // Update the link count 94 // Update the link count
94 virtual void Link(); 95 virtual void Link();
95 virtual void Unlink(); 96 virtual void Unlink();
96 97
97 protected: 98 protected:
98 struct stat stat_; 99 struct stat stat_;
100 SimpleLock node_lock_;
99 101
100 // We use a pointer directly to avoid cycles in the ref count. 102 // We use a pointer directly to avoid cycles in the ref count.
101 // TODO(noelallen) We should change this so it's unnecessary for the node 103 // TODO(noelallen) We should change this so it's unnecessary for the node
102 // to track it's parent. When a node is unlinked, the mount should do 104 // to track it's parent. When a node is unlinked, the mount should do
103 // any cleanup it needs. 105 // any cleanup it needs.
104 Mount* mount_; 106 Mount* mount_;
105 107
106 friend class Mount; 108 friend class Mount;
107 friend class MountDev; 109 friend class MountDev;
108 friend class MountHtml5Fs; 110 friend class MountHtml5Fs;
109 friend class MountHttp; 111 friend class MountHttp;
110 friend class MountMem; 112 friend class MountMem;
111 friend class MountNodeDir; 113 friend class MountNodeDir;
112 }; 114 };
113 115
114 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_H_ 116 #endif // LIBRARIES_NACL_IO_MOUNT_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698