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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/mount_mem.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 hromium 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_mem.h" 5 #include "nacl_io/mount_mem.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "nacl_io/mount.h" 12 #include "nacl_io/mount.h"
13 #include "nacl_io/mount_node.h" 13 #include "nacl_io/mount_node.h"
14 #include "nacl_io/mount_node_dir.h" 14 #include "nacl_io/mount_node_dir.h"
15 #include "nacl_io/mount_node_mem.h" 15 #include "nacl_io/mount_node_mem.h"
16 #include "nacl_io/osstat.h" 16 #include "nacl_io/osstat.h"
17 #include "nacl_io/osunistd.h" 17 #include "nacl_io/osunistd.h"
18 #include "nacl_io/path.h" 18 #include "nacl_io/path.h"
19 #include "sdk_util/auto_lock.h" 19 #include "sdk_util/auto_lock.h"
20 #include "sdk_util/ref_object.h" 20 #include "sdk_util/ref_object.h"
21 21
22 namespace nacl_io {
23
22 MountMem::MountMem() : root_(NULL) {} 24 MountMem::MountMem() : root_(NULL) {}
23 25
24 Error MountMem::Init(int dev, StringMap_t& args, PepperInterface* ppapi) { 26 Error MountMem::Init(int dev, StringMap_t& args, PepperInterface* ppapi) {
25 Error error = Mount::Init(dev, args, ppapi); 27 Error error = Mount::Init(dev, args, ppapi);
26 if (error) 28 if (error)
27 return error; 29 return error;
28 30
29 root_.reset(new MountNodeDir(this)); 31 root_.reset(new MountNodeDir(this));
30 error = root_->Init(S_IREAD | S_IWRITE); 32 error = root_->Init(S_IREAD | S_IWRITE);
31 if (error) { 33 if (error) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 216
215 if (file_only && child->IsaDir()) 217 if (file_only && child->IsaDir())
216 return EISDIR; 218 return EISDIR;
217 219
218 if (remove_dir && child->ChildCount() > 0) 220 if (remove_dir && child->ChildCount() > 0)
219 return ENOTEMPTY; 221 return ENOTEMPTY;
220 222
221 return parent->RemoveChild(path.Basename()); 223 return parent->RemoveChild(path.Basename());
222 } 224 }
223 225
226 } // namespace nacl_io
227
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/mount_mem.h ('k') | native_client_sdk/src/libraries/nacl_io/mount_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698