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

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

Issue 2854833004: Use SharedMemoryHandle instead ScopedHandle as ivar for SharedMemory (Closed)
Patch Set: close should be idempotent. Created 3 years, 7 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 | « no previous file | base/memory/shared_memory_handle.h » ('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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_ANDROID) && \ 234 #if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_ANDROID) && \
235 (!defined(OS_MACOSX) || defined(OS_IOS)) 235 (!defined(OS_MACOSX) || defined(OS_IOS))
236 bool FilePathForMemoryName(const std::string& mem_name, FilePath* path); 236 bool FilePathForMemoryName(const std::string& mem_name, FilePath* path);
237 #endif 237 #endif
238 238
239 #if defined(OS_WIN) 239 #if defined(OS_WIN)
240 // If true indicates this came from an external source so needs extra checks 240 // If true indicates this came from an external source so needs extra checks
241 // before being mapped. 241 // before being mapped.
242 bool external_section_; 242 bool external_section_;
243 std::wstring name_; 243 std::wstring name_;
244 win::ScopedHandle mapped_file_;
245 #else 244 #else
246 // The OS primitive that backs the shared memory region.
247 SharedMemoryHandle shm_;
248 245
249 // If valid, points to the same memory region as shm_, but with readonly 246 // If valid, points to the same memory region as shm_, but with readonly
250 // permissions. 247 // permissions.
251 SharedMemoryHandle readonly_shm_; 248 SharedMemoryHandle readonly_shm_;
252 #endif 249 #endif
253 250
254 #if defined(OS_MACOSX) && !defined(OS_IOS) 251 #if defined(OS_MACOSX) && !defined(OS_IOS)
255 // The mechanism by which the memory is mapped. Only valid if |memory_| is not 252 // The mechanism by which the memory is mapped. Only valid if |memory_| is not
256 // |nullptr|. 253 // |nullptr|.
257 SharedMemoryHandle::Type mapped_memory_mechanism_; 254 SharedMemoryHandle::Type mapped_memory_mechanism_;
258 #endif 255 #endif
259 256
257 // The OS primitive that backs the shared memory region.
258 SharedMemoryHandle shm_;
259
260 size_t mapped_size_; 260 size_t mapped_size_;
261 void* memory_; 261 void* memory_;
262 bool read_only_; 262 bool read_only_;
263 size_t requested_size_; 263 size_t requested_size_;
264 264
265 DISALLOW_COPY_AND_ASSIGN(SharedMemory); 265 DISALLOW_COPY_AND_ASSIGN(SharedMemory);
266 }; 266 };
267 267
268 } // namespace base 268 } // namespace base
269 269
270 #endif // BASE_MEMORY_SHARED_MEMORY_H_ 270 #endif // BASE_MEMORY_SHARED_MEMORY_H_
OLDNEW
« no previous file with comments | « no previous file | base/memory/shared_memory_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698