OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/shared_memory.h" | 5 #include "base/memory/shared_memory.h" |
6 | 6 |
| 7 #include <stddef.h> |
7 #include <sys/mman.h> | 8 #include <sys/mman.h> |
8 | 9 |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "third_party/ashmem/ashmem.h" | 11 #include "third_party/ashmem/ashmem.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 | 14 |
14 // For Android, we use ashmem to implement SharedMemory. ashmem_create_region | 15 // For Android, we use ashmem to implement SharedMemory. ashmem_create_region |
15 // will automatically pin the region. We never explicitly call pin/unpin. When | 16 // will automatically pin the region. We never explicitly call pin/unpin. When |
16 // all the file descriptors from different processes associated with the region | 17 // all the file descriptors from different processes associated with the region |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return true; | 58 return true; |
58 } | 59 } |
59 | 60 |
60 bool SharedMemory::Open(const std::string& name, bool read_only) { | 61 bool SharedMemory::Open(const std::string& name, bool read_only) { |
61 // ashmem doesn't support name mapping | 62 // ashmem doesn't support name mapping |
62 NOTIMPLEMENTED(); | 63 NOTIMPLEMENTED(); |
63 return false; | 64 return false; |
64 } | 65 } |
65 | 66 |
66 } // namespace base | 67 } // namespace base |
OLD | NEW |