| 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 #include "nacl_mounts/kernel_proxy.h" | 5 #include "nacl_mounts/kernel_proxy.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <pthread.h> | 9 #include <pthread.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "nacl_mounts/kernel_handle.h" | 13 #include "nacl_mounts/kernel_handle.h" |
| 14 #include "nacl_mounts/mount.h" | 14 #include "nacl_mounts/mount.h" |
| 15 #include "nacl_mounts/mount_dev.h" | 15 #include "nacl_mounts/mount_dev.h" |
| 16 #include "nacl_mounts/mount_html5fs.h" | 16 #include "nacl_mounts/mount_html5fs.h" |
| 17 #include "nacl_mounts/mount_http.h" |
| 17 #include "nacl_mounts/mount_mem.h" | 18 #include "nacl_mounts/mount_mem.h" |
| 18 #include "nacl_mounts/mount_node.h" | 19 #include "nacl_mounts/mount_node.h" |
| 19 #include "nacl_mounts/osstat.h" | 20 #include "nacl_mounts/osstat.h" |
| 20 #include "nacl_mounts/path.h" | 21 #include "nacl_mounts/path.h" |
| 21 #include "nacl_mounts/pepper_interface.h" | 22 #include "nacl_mounts/pepper_interface.h" |
| 22 #include "utils/auto_lock.h" | 23 #include "utils/auto_lock.h" |
| 23 #include "utils/ref_object.h" | 24 #include "utils/ref_object.h" |
| 24 | 25 |
| 25 #ifndef MAXPATHLEN | 26 #ifndef MAXPATHLEN |
| 26 #define MAXPATHLEN 256 | 27 #define MAXPATHLEN 256 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 } | 42 } |
| 42 | 43 |
| 43 void KernelProxy::Init(PepperInterface* ppapi) { | 44 void KernelProxy::Init(PepperInterface* ppapi) { |
| 44 ppapi_ = ppapi; | 45 ppapi_ = ppapi; |
| 45 cwd_ = "/"; | 46 cwd_ = "/"; |
| 46 dev_ = 1; | 47 dev_ = 1; |
| 47 | 48 |
| 48 factories_["memfs"] = MountMem::Create<MountMem>; | 49 factories_["memfs"] = MountMem::Create<MountMem>; |
| 49 factories_["dev"] = MountDev::Create<MountDev>; | 50 factories_["dev"] = MountDev::Create<MountDev>; |
| 50 factories_["html5fs"] = MountHtml5Fs::Create<MountHtml5Fs>; | 51 factories_["html5fs"] = MountHtml5Fs::Create<MountHtml5Fs>; |
| 52 factories_["httpfs"] = MountHttp::Create<MountHttp>; |
| 51 | 53 |
| 52 // Create memory mount at root | 54 // Create memory mount at root |
| 53 StringMap_t smap; | 55 StringMap_t smap; |
| 54 mounts_["/"] = MountMem::Create<MountMem>(dev_++, smap, ppapi_); | 56 mounts_["/"] = MountMem::Create<MountMem>(dev_++, smap, ppapi_); |
| 55 mounts_["/dev"] = MountDev::Create<MountDev>(dev_++, smap, ppapi_); | 57 mounts_["/dev"] = MountDev::Create<MountDev>(dev_++, smap, ppapi_); |
| 56 } | 58 } |
| 57 | 59 |
| 58 int KernelProxy::open(const char *path, int oflags) { | 60 int KernelProxy::open(const char *path, int oflags) { |
| 59 Path rel; | 61 Path rel; |
| 60 | 62 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // TODO(noelallen): Needs implementation. | 379 // TODO(noelallen): Needs implementation. |
| 378 int KernelProxy::fchmod(int fd, int mode) { | 380 int KernelProxy::fchmod(int fd, int mode) { |
| 379 errno = EINVAL; | 381 errno = EINVAL; |
| 380 return -1; | 382 return -1; |
| 381 } | 383 } |
| 382 | 384 |
| 383 int KernelProxy::access(const char* path, int amode) { | 385 int KernelProxy::access(const char* path, int amode) { |
| 384 errno = EINVAL; | 386 errno = EINVAL; |
| 385 return -1; | 387 return -1; |
| 386 } | 388 } |
| OLD | NEW |