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

Side by Side Diff: base/memory/shared_memory_mac.cc

Issue 1529283002: Cleanup: Remove unused SharedMemory ctor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nope, revert Created 5 years 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
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <mach/mach_vm.h> 9 #include <mach/mach_vm.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only) 201 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only)
202 : shm_(handle), 202 : shm_(handle),
203 mapped_memory_mechanism_(SharedMemoryHandle::POSIX), 203 mapped_memory_mechanism_(SharedMemoryHandle::POSIX),
204 readonly_mapped_file_(-1), 204 readonly_mapped_file_(-1),
205 mapped_size_(0), 205 mapped_size_(0),
206 memory_(NULL), 206 memory_(NULL),
207 read_only_(read_only), 207 read_only_(read_only),
208 requested_size_(0) {} 208 requested_size_(0) {}
209 209
210 SharedMemory::SharedMemory(const SharedMemoryHandle& handle,
211 bool read_only,
212 ProcessHandle process)
213 : mapped_memory_mechanism_(SharedMemoryHandle::POSIX),
214 readonly_mapped_file_(-1),
215 mapped_size_(0),
216 memory_(NULL),
217 read_only_(read_only),
218 requested_size_(0) {
219 // We don't handle this case yet (note the ignored parameter); let's die if
220 // someone comes calling.
221 NOTREACHED();
222 }
223
224 SharedMemory::~SharedMemory() { 210 SharedMemory::~SharedMemory() {
225 Unmap(); 211 Unmap();
226 Close(); 212 Close();
227 } 213 }
228 214
229 // static 215 // static
230 bool SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) { 216 bool SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) {
231 return handle.IsValid(); 217 return handle.IsValid();
232 } 218 }
233 219
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 477
492 if (close_self) { 478 if (close_self) {
493 Unmap(); 479 Unmap();
494 Close(); 480 Close();
495 } 481 }
496 482
497 return true; 483 return true;
498 } 484 }
499 485
500 } // namespace base 486 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698