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

Side by Side Diff: base/memory/shared_memory.h

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 | « no previous file | base/memory/shared_memory_mac.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 #ifndef BASE_MEMORY_SHARED_MEMORY_H_ 5 #ifndef BASE_MEMORY_SHARED_MEMORY_H_
6 #define BASE_MEMORY_SHARED_MEMORY_H_ 6 #define BASE_MEMORY_SHARED_MEMORY_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <string> 10 #include <string>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 // Create a new SharedMemory object from an existing, open 78 // Create a new SharedMemory object from an existing, open
79 // shared memory file. 79 // shared memory file.
80 // 80 //
81 // WARNING: This does not reduce the OS-level permissions on the handle; it 81 // WARNING: This does not reduce the OS-level permissions on the handle; it
82 // only affects how the SharedMemory will be mmapped. Use 82 // only affects how the SharedMemory will be mmapped. Use
83 // ShareReadOnlyToProcess to drop permissions. TODO(jln,jyasskin): DCHECK 83 // ShareReadOnlyToProcess to drop permissions. TODO(jln,jyasskin): DCHECK
84 // that |read_only| matches the permissions of the handle. 84 // that |read_only| matches the permissions of the handle.
85 SharedMemory(const SharedMemoryHandle& handle, bool read_only); 85 SharedMemory(const SharedMemoryHandle& handle, bool read_only);
86 86
87 #if defined(OS_WIN)
87 // Create a new SharedMemory object from an existing, open 88 // Create a new SharedMemory object from an existing, open
88 // shared memory file that was created by a remote process and not shared 89 // shared memory file that was created by a remote process and not shared
89 // to the current process. 90 // to the current process.
90 SharedMemory(const SharedMemoryHandle& handle, 91 SharedMemory(const SharedMemoryHandle& handle,
91 bool read_only, 92 bool read_only,
92 ProcessHandle process); 93 ProcessHandle process);
94 #endif
93 95
94 // Closes any open files. 96 // Closes any open files.
95 ~SharedMemory(); 97 ~SharedMemory();
96 98
97 // Return true iff the given handle is valid (i.e. not the distingished 99 // Return true iff the given handle is valid (i.e. not the distingished
98 // invalid value; NULL for a HANDLE and -1 for a file descriptor) 100 // invalid value; NULL for a HANDLE and -1 for a file descriptor)
99 static bool IsHandleValid(const SharedMemoryHandle& handle); 101 static bool IsHandleValid(const SharedMemoryHandle& handle);
100 102
101 // Returns invalid handle (see comment above for exact definition). 103 // Returns invalid handle (see comment above for exact definition).
102 static SharedMemoryHandle NULLHandle(); 104 static SharedMemoryHandle NULLHandle();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 size_t mapped_size_; 302 size_t mapped_size_;
301 void* memory_; 303 void* memory_;
302 bool read_only_; 304 bool read_only_;
303 size_t requested_size_; 305 size_t requested_size_;
304 306
305 DISALLOW_COPY_AND_ASSIGN(SharedMemory); 307 DISALLOW_COPY_AND_ASSIGN(SharedMemory);
306 }; 308 };
307 } // namespace base 309 } // namespace base
308 310
309 #endif // BASE_MEMORY_SHARED_MEMORY_H_ 311 #endif // BASE_MEMORY_SHARED_MEMORY_H_
OLDNEW
« no previous file with comments | « no previous file | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698