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

Unified Diff: native_client_sdk/src/libraries/nacl_mounts/mount.h

Issue 10829027: [NaCl SDK] Add nacl_mounts to NaCl SDK build. Experimental for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 8 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_mounts/mount.h
diff --git a/native_client_sdk/src/libraries/nacl_mounts/mount.h b/native_client_sdk/src/libraries/nacl_mounts/mount.h
index 866a829bae9a78a49d1dd466b567b6f5214cfb53..cbb80149fd365d87d2ad7138b020c7462a31d9b7 100644
--- a/native_client_sdk/src/libraries/nacl_mounts/mount.h
+++ b/native_client_sdk/src/libraries/nacl_mounts/mount.h
@@ -5,42 +5,19 @@
#ifndef LIBRARIES_NACL_MOUNTS_MOUNT_H_
#define LIBRARIES_NACL_MOUNTS_MOUNT_H_
-#include <stdint.h>
#include <map>
#include <string>
-#include "macros.h"
-#include "ref_object.h"
-
#include "nacl_mounts/mount_node.h"
#include "nacl_mounts/path.h"
-
-struct dirent;
-struct stat;
+#include "utils/macros.h"
+#include "utils/ref_object.h"
class MountNode;
class MountManager;
typedef std::map<std::string, std::string> StringMap_t;
-template<class C, class P> class MountFactory : public P {
- protected:
- MountFactory()
- : P() {}
-
- static Mount* Create(int dev, StringMap_t& args) {
- Mount* mnt = new C();
- if (mnt->Init(dev, args) == false) {
- delete mnt;
- return NULL;
- }
- return mnt;
- }
-
- friend class KernelProxy;
-};
-
-
// Mount serves as the base mounting class that will be used by
// the mount manager (class MountManager). The mount manager
@@ -89,17 +66,33 @@ class Mount : public RefObject {
int dev_;
private:
- // May only be called by the KernelProxy when the Kernel's
+ // May only be called by the KernelProxy when the Kernel's
// lock is held, so we make it private.
friend class KernelObject;
friend class KernelProxy;
void Acquire() { RefObject::Acquire(); }
- bool Release() { return RefObject::Release(); }
+ void Release() { RefObject::Release(); }
template <class M, class P> friend class MountFactory;
DISALLOW_COPY_AND_ASSIGN(Mount);
};
-#endif // LIBRARIES_NACL_MOUNTS_MOUNT_H_
+template<class C, class P> class MountFactory : public P {
+ protected:
+ MountFactory()
+ : P() {}
+ static Mount* Create(int dev, StringMap_t& args) {
+ Mount* mnt = new C();
binji 2012/07/26 22:49:58 gcc complained that Mount was used before it was d
+ if (mnt->Init(dev, args) == false) {
+ delete mnt;
+ return NULL;
+ }
+ return mnt;
+ }
+
+ friend class KernelProxy;
+};
+
+#endif // LIBRARIES_NACL_MOUNTS_MOUNT_H_

Powered by Google App Engine
This is Rietveld 408576698