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

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

Issue 1200473003: Revert of Make SharedMemoryHandle a class on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_make_class3_base
Patch Set: Created 5 years, 6 months 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_mac.cc ('k') | base/memory/shared_memory_posix.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 <sys/mman.h> 9 #include <sys/mman.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 12
13 #include <limits> 13 #include <limits>
14 14
15 #include "base/logging.h" 15 #include "base/logging.h"
16 16
17 namespace base { 17 namespace base {
18 18
19 SharedMemory::SharedMemory() 19 SharedMemory::SharedMemory()
20 : mapped_file_(-1), 20 : mapped_file_(-1),
21 mapped_size_(0), 21 mapped_size_(0),
22 memory_(NULL), 22 memory_(NULL),
23 read_only_(false), 23 read_only_(false),
24 requested_size_(0) { 24 requested_size_(0) {
25 } 25 }
26 26
27 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only) 27 SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only)
28 : mapped_file_(handle.fd), 28 : mapped_file_(handle.fd),
29 mapped_size_(0), 29 mapped_size_(0),
30 memory_(NULL), 30 memory_(NULL),
31 read_only_(read_only), 31 read_only_(read_only),
32 requested_size_(0) { 32 requested_size_(0) {
33 } 33 }
34 34
35 SharedMemory::SharedMemory(const SharedMemoryHandle& handle, 35 SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only,
36 bool read_only,
37 ProcessHandle process) 36 ProcessHandle process)
38 : mapped_file_(handle.fd), 37 : mapped_file_(handle.fd),
39 mapped_size_(0), 38 mapped_size_(0),
40 memory_(NULL), 39 memory_(NULL),
41 read_only_(read_only), 40 read_only_(read_only),
42 requested_size_(0) { 41 requested_size_(0) {
43 NOTREACHED(); 42 NOTREACHED();
44 } 43 }
45 44
46 SharedMemory::~SharedMemory() { 45 SharedMemory::~SharedMemory() {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 new_handle->auto_close = true; 158 new_handle->auto_close = true;
160 159
161 if (close_self) { 160 if (close_self) {
162 Unmap(); 161 Unmap();
163 Close(); 162 Close();
164 } 163 }
165 return true; 164 return true;
166 } 165 }
167 166
168 } // namespace base 167 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_mac.cc ('k') | base/memory/shared_memory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698