| 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 "base/memory/shared_memory.h" | 5 #include "base/memory/shared_memory.h" |
| 6 | 6 |
| 7 #include <mach/mach_vm.h> | 7 #include <mach/mach_vm.h> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace | 70 } // namespace |
| 71 | 71 |
| 72 SharedMemoryCreateOptions::SharedMemoryCreateOptions() | 72 SharedMemoryCreateOptions::SharedMemoryCreateOptions() |
| 73 : size(0), | 73 : size(0), |
| 74 executable(false), | 74 executable(false), |
| 75 share_read_only(false) {} | 75 share_read_only(false) {} |
| 76 | 76 |
| 77 SharedMemory::SharedMemory() | 77 SharedMemory::SharedMemory() |
| 78 : readonly_mapped_file_(-1), | 78 : mapped_size_(0), memory_(NULL), read_only_(false), requested_size_(0) {} |
| 79 mapped_size_(0), | |
| 80 memory_(NULL), | |
| 81 read_only_(false), | |
| 82 requested_size_(0) {} | |
| 83 | 79 |
| 84 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only) | 80 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only) |
| 85 : shm_(handle), | 81 : shm_(handle), |
| 86 readonly_mapped_file_(-1), | |
| 87 mapped_size_(0), | 82 mapped_size_(0), |
| 88 memory_(NULL), | 83 memory_(NULL), |
| 89 read_only_(read_only), | 84 read_only_(read_only), |
| 90 requested_size_(0) {} | 85 requested_size_(0) {} |
| 91 | 86 |
| 92 SharedMemory::~SharedMemory() { | 87 SharedMemory::~SharedMemory() { |
| 93 Unmap(); | 88 Unmap(); |
| 94 Close(); | 89 Close(); |
| 95 } | 90 } |
| 96 | 91 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 209 |
| 215 if (close_self) { | 210 if (close_self) { |
| 216 Unmap(); | 211 Unmap(); |
| 217 Close(); | 212 Close(); |
| 218 } | 213 } |
| 219 | 214 |
| 220 return success; | 215 return success; |
| 221 } | 216 } |
| 222 | 217 |
| 223 } // namespace base | 218 } // namespace base |
| OLD | NEW |