| 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_io/mount.h" | 5 #include "nacl_io/mount.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "nacl_io/mount_node.h" | 11 #include "nacl_io/mount_node.h" |
| 12 #include "nacl_io/mount_node_dir.h" | 12 #include "nacl_io/mount_node_dir.h" |
| 13 #include "nacl_io/mount_node_mem.h" | 13 #include "nacl_io/mount_node_mem.h" |
| 14 #include "nacl_io/osstat.h" | 14 #include "nacl_io/osstat.h" |
| 15 #include "nacl_io/path.h" | 15 #include "nacl_io/path.h" |
| 16 #include "sdk_util/auto_lock.h" | 16 #include "sdk_util/auto_lock.h" |
| 17 #include "sdk_util/ref_object.h" | 17 #include "sdk_util/ref_object.h" |
| 18 | 18 |
| 19 #if defined(WIN32) | 19 #if defined(WIN32) |
| 20 #include <windows.h> | 20 #include <windows.h> |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 namespace nacl_io { |
| 24 |
| 23 Mount::Mount() : dev_(0) {} | 25 Mount::Mount() : dev_(0) {} |
| 24 | 26 |
| 25 Mount::~Mount() {} | 27 Mount::~Mount() {} |
| 26 | 28 |
| 27 Error Mount::Init(int dev, StringMap_t& args, PepperInterface* ppapi) { | 29 Error Mount::Init(int dev, StringMap_t& args, PepperInterface* ppapi) { |
| 28 dev_ = dev; | 30 dev_ = dev; |
| 29 ppapi_ = ppapi; | 31 ppapi_ = ppapi; |
| 30 return 0; | 32 return 0; |
| 31 } | 33 } |
| 32 | 34 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 void Mount::OnNodeCreated(MountNode* node) { | 55 void Mount::OnNodeCreated(MountNode* node) { |
| 54 node->stat_.st_ino = inode_pool_.Acquire(); | 56 node->stat_.st_ino = inode_pool_.Acquire(); |
| 55 node->stat_.st_dev = dev_; | 57 node->stat_.st_dev = dev_; |
| 56 } | 58 } |
| 57 | 59 |
| 58 void Mount::OnNodeDestroyed(MountNode* node) { | 60 void Mount::OnNodeDestroyed(MountNode* node) { |
| 59 if (node->stat_.st_ino) | 61 if (node->stat_.st_ino) |
| 60 inode_pool_.Release(node->stat_.st_ino); | 62 inode_pool_.Release(node->stat_.st_ino); |
| 61 } | 63 } |
| 62 | 64 |
| 65 } // namespace nacl_io |
| 66 |
| OLD | NEW |