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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/mount_node_dir.cc

Issue 19717004: [NaCl SDK] Add nacl_io and sdk_util namespaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad copyright in mount_mem 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 #include "nacl_io/mount_node_dir.h" 5 #include "nacl_io/mount_node_dir.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "nacl_io/osdirent.h" 10 #include "nacl_io/osdirent.h"
11 #include "nacl_io/osstat.h" 11 #include "nacl_io/osstat.h"
12 #include "sdk_util/auto_lock.h" 12 #include "sdk_util/auto_lock.h"
13 #include "sdk_util/macros.h" 13 #include "sdk_util/macros.h"
14 14
15 namespace nacl_io {
16
15 MountNodeDir::MountNodeDir(Mount* mount) : MountNode(mount), cache_(NULL) { 17 MountNodeDir::MountNodeDir(Mount* mount) : MountNode(mount), cache_(NULL) {
16 stat_.st_mode |= S_IFDIR; 18 stat_.st_mode |= S_IFDIR;
17 } 19 }
18 20
19 MountNodeDir::~MountNodeDir() { 21 MountNodeDir::~MountNodeDir() {
20 for (MountNodeMap_t::iterator it = map_.begin(); it != map_.end(); ++it) { 22 for (MountNodeMap_t::iterator it = map_.begin(); it != map_.end(); ++it) {
21 it->second->Unlink(); 23 it->second->Unlink();
22 } 24 }
23 free(cache_); 25 free(cache_);
24 } 26 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 size_t len = it->first.length(); 138 size_t len = it->first.length();
137 cache_[index].d_ino = it->second->stat_.st_ino; 139 cache_[index].d_ino = it->second->stat_.st_ino;
138 cache_[index].d_off = sizeof(struct dirent); 140 cache_[index].d_off = sizeof(struct dirent);
139 cache_[index].d_reclen = sizeof(struct dirent); 141 cache_[index].d_reclen = sizeof(struct dirent);
140 cache_[index].d_name[len] = 0; 142 cache_[index].d_name[len] = 0;
141 strncpy(cache_[index].d_name, &it->first[0], len); 143 strncpy(cache_[index].d_name, &it->first[0], len);
142 } 144 }
143 } 145 }
144 } 146 }
145 147
148 } // namespace nacl_io
149
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/mount_node_dir.h ('k') | native_client_sdk/src/libraries/nacl_io/mount_node_html5fs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698