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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_proxy.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/kernel_proxy.h" 5 #include "nacl_io/kernel_proxy.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <pthread.h> 10 #include <pthread.h>
(...skipping 15 matching lines...) Expand all
26 #include "nacl_io/path.h" 26 #include "nacl_io/path.h"
27 #include "nacl_io/pepper_interface.h" 27 #include "nacl_io/pepper_interface.h"
28 #include "nacl_io/typed_mount_factory.h" 28 #include "nacl_io/typed_mount_factory.h"
29 #include "sdk_util/auto_lock.h" 29 #include "sdk_util/auto_lock.h"
30 #include "sdk_util/ref_object.h" 30 #include "sdk_util/ref_object.h"
31 31
32 #ifndef MAXPATHLEN 32 #ifndef MAXPATHLEN
33 #define MAXPATHLEN 256 33 #define MAXPATHLEN 256
34 #endif 34 #endif
35 35
36 // TODO(noelallen) : Grab/Redefine these in the kernel object once available. 36 namespace nacl_io {
37 #define USR_ID 1002
38 #define GRP_ID 1003
39 37
40 KernelProxy::KernelProxy() : dev_(0), ppapi_(NULL) { 38 KernelProxy::KernelProxy() : dev_(0), ppapi_(NULL) {
41 } 39 }
42 40
43 KernelProxy::~KernelProxy() { 41 KernelProxy::~KernelProxy() {
44 // Clean up the MountFactories. 42 // Clean up the MountFactories.
45 for (MountFactoryMap_t::iterator i = factories_.begin(); 43 for (MountFactoryMap_t::iterator i = factories_.begin();
46 i != factories_.end(); 44 i != factories_.end();
47 ++i) { 45 ++i) {
48 delete i->second; 46 delete i->second;
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 // Unfortunately, munmap still needs to acquire other locks; see the call to 633 // Unfortunately, munmap still needs to acquire other locks; see the call to
636 // ReleaseHandle below which takes the process lock. This is safe as long as 634 // ReleaseHandle below which takes the process lock. This is safe as long as
637 // this is never executed from free() -- we can be reasonably sure this is 635 // this is never executed from free() -- we can be reasonably sure this is
638 // true, because malloc only makes anonymous mmap() requests, and should only 636 // true, because malloc only makes anonymous mmap() requests, and should only
639 // be munmapping those allocations. We never add to mmap_info_list_ for 637 // be munmapping those allocations. We never add to mmap_info_list_ for
640 // anonymous maps, so the unmap_list should always be empty when called from 638 // anonymous maps, so the unmap_list should always be empty when called from
641 // free(). 639 // free().
642 return 0; 640 return 0;
643 } 641 }
644 642
643 } // namespace nacl_io
644
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.h ('k') | native_client_sdk/src/libraries/nacl_io/mount.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698