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

Side by Side Diff: base/memory/shared_memory_posix.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_nacl.cc ('k') | no next file » | 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 <sys/mman.h> 9 #include <sys/mman.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only) 117 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only)
118 : mapped_file_(handle.fd), 118 : mapped_file_(handle.fd),
119 readonly_mapped_file_(-1), 119 readonly_mapped_file_(-1),
120 mapped_size_(0), 120 mapped_size_(0),
121 memory_(NULL), 121 memory_(NULL),
122 read_only_(read_only), 122 read_only_(read_only),
123 requested_size_(0) { 123 requested_size_(0) {
124 } 124 }
125 125
126 SharedMemory::SharedMemory(const SharedMemoryHandle& handle,
127 bool read_only,
128 ProcessHandle process)
129 : mapped_file_(handle.fd),
130 readonly_mapped_file_(-1),
131 mapped_size_(0),
132 memory_(NULL),
133 read_only_(read_only),
134 requested_size_(0) {
135 // We don't handle this case yet (note the ignored parameter); let's die if
136 // someone comes calling.
137 NOTREACHED();
138 }
139
140 SharedMemory::~SharedMemory() { 126 SharedMemory::~SharedMemory() {
141 Unmap(); 127 Unmap();
142 Close(); 128 Close();
143 } 129 }
144 130
145 // static 131 // static
146 bool SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) { 132 bool SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) {
147 return handle.fd >= 0; 133 return handle.fd >= 0;
148 } 134 }
149 135
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 492
507 if (close_self) { 493 if (close_self) {
508 Unmap(); 494 Unmap();
509 Close(); 495 Close();
510 } 496 }
511 497
512 return true; 498 return true;
513 } 499 }
514 500
515 } // namespace base 501 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_nacl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698