Chromium Code Reviews| 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_KERNEL_PROXY_H_ | 5 #ifndef LIBRARIES_NACL_IO_KERNEL_PROXY_H_ |
| 6 #define LIBRARIES_NACL_IO_KERNEL_PROXY_H_ | 6 #define LIBRARIES_NACL_IO_KERNEL_PROXY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 // responsible for taking the locks of the KernelHandle, and Node objects. For | 34 // responsible for taking the locks of the KernelHandle, and Node objects. For |
| 35 // this reason, a KernelObject call should not be done while holding a handle | 35 // this reason, a KernelObject call should not be done while holding a handle |
| 36 // or node lock. In addition, to ensure locking order, a KernelHandle lock | 36 // or node lock. In addition, to ensure locking order, a KernelHandle lock |
| 37 // must never be taken after taking the associated Node's lock. | 37 // must never be taken after taking the associated Node's lock. |
| 38 // | 38 // |
| 39 // NOTE: The KernelProxy is the only class that should be setting errno. All | 39 // NOTE: The KernelProxy is the only class that should be setting errno. All |
| 40 // other classes should return Error (as defined by nacl_io/error.h). | 40 // other classes should return Error (as defined by nacl_io/error.h). |
| 41 class KernelProxy : protected KernelObject { | 41 class KernelProxy : protected KernelObject { |
| 42 public: | 42 public: |
| 43 typedef std::map<std::string, FsFactory*> FsFactoryMap_t; | 43 typedef std::map<std::string, FsFactory*> FsFactoryMap_t; |
| 44 typedef std::map<int, std::string> FdPathMap_t; | |
| 44 | 45 |
| 45 KernelProxy(); | 46 KernelProxy(); |
| 46 virtual ~KernelProxy(); | 47 virtual ~KernelProxy(); |
| 47 | 48 |
| 48 // Takes ownership of |ppapi|. | 49 // Takes ownership of |ppapi|. |
| 49 // |ppapi| may be NULL. If so, no filesystem that uses pepper calls can be | 50 // |ppapi| may be NULL. If so, no filesystem that uses pepper calls can be |
| 50 // mounted. | 51 // mounted. |
| 51 virtual Error Init(PepperInterface* ppapi); | 52 virtual Error Init(PepperInterface* ppapi); |
| 52 | 53 |
| 53 // Register/Unregister a new filesystem type. See the documentation in | 54 // Register/Unregister a new filesystem type. See the documentation in |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 int optname, | 192 int optname, |
| 192 const void* optval, | 193 const void* optval, |
| 193 socklen_t len); | 194 socklen_t len); |
| 194 virtual int shutdown(int fd, int how); | 195 virtual int shutdown(int fd, int how); |
| 195 virtual int socket(int domain, int type, int protocol); | 196 virtual int socket(int domain, int type, int protocol); |
| 196 virtual int socketpair(int domain, int type, int protocol, int* sv); | 197 virtual int socketpair(int domain, int type, int protocol, int* sv); |
| 197 #endif // PROVIDES_SOCKET_API | 198 #endif // PROVIDES_SOCKET_API |
| 198 | 199 |
| 199 protected: | 200 protected: |
| 200 FsFactoryMap_t factories_; | 201 FsFactoryMap_t factories_; |
| 202 FdPathMap_t fd_paths_; | |
|
binji
2014/01/06 19:32:04
this should probably be in KernelObject
| |
| 201 sdk_util::ScopedRef<StreamFs> stream_mount_; | 203 sdk_util::ScopedRef<StreamFs> stream_mount_; |
| 202 int dev_; | 204 int dev_; |
| 203 PepperInterface* ppapi_; | 205 PepperInterface* ppapi_; |
| 204 static KernelProxy *s_instance_; | 206 static KernelProxy *s_instance_; |
| 205 struct sigaction sigwinch_handler_; | 207 struct sigaction sigwinch_handler_; |
| 206 #ifdef PROVIDES_SOCKET_API | 208 #ifdef PROVIDES_SOCKET_API |
| 207 HostResolver host_resolver_; | 209 HostResolver host_resolver_; |
| 208 #endif | 210 #endif |
| 209 | 211 |
| 210 #ifdef PROVIDES_SOCKET_API | 212 #ifdef PROVIDES_SOCKET_API |
| 211 virtual int AcquireSocketHandle(int fd, ScopedKernelHandle* handle); | 213 virtual int AcquireSocketHandle(int fd, ScopedKernelHandle* handle); |
| 212 #endif | 214 #endif |
| 213 | 215 |
| 214 ScopedEventEmitter signal_emitter_; | 216 ScopedEventEmitter signal_emitter_; |
| 215 DISALLOW_COPY_AND_ASSIGN(KernelProxy); | 217 DISALLOW_COPY_AND_ASSIGN(KernelProxy); |
| 216 }; | 218 }; |
| 217 | 219 |
| 218 } // namespace nacl_io | 220 } // namespace nacl_io |
| 219 | 221 |
| 220 #endif // LIBRARIES_NACL_IO_KERNEL_PROXY_H_ | 222 #endif // LIBRARIES_NACL_IO_KERNEL_PROXY_H_ |
| OLD | NEW |