| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |