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

Unified Diff: base/shared_memory.h

Issue 11876037: Added SharedMemory::MapFrom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/shared_memory_nacl.cc » ('j') | base/shared_memory_posix.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory.h
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 4eefdbb68bde5d69bd65d79e48650e8ba1b7abc4..a13cb0456ebf709cc97db9849691d900e6516574 100644
--- a/base/shared_memory.h
+++ b/base/shared_memory.h
@@ -144,7 +144,14 @@ class BASE_EXPORT SharedMemory {
// Returns true on success, false otherwise. The memory address
// is accessed via the memory() accessor. The mapped address is guaranteed to
// have an alignment of at least MAP_MINIMUM_ALIGNMENT.
- bool Map(size_t bytes);
+ bool Map(size_t bytes) {
+ return MapFrom(0, bytes);
+ }
+
+ // Same as above, but with |offset| to specify from begining of the shared
+ // memory block to map.
+ // |offset| must be alignent to value of |SysInfo::VMAllocationGranularity()|.
+ bool MapFrom(off_t offset, size_t bytes);
Mark Mentovai 2013/01/15 21:51:42 Isn’t this more MapAt than MapFrom?
Vitaly Buka (NO REVIEWS) 2013/01/15 22:13:05 Done. Ideally I'd included offest to Map() interf
enum { MAP_MINIMUM_ALIGNMENT = 32 };
// Unmaps the shared memory from the caller's address space.
« no previous file with comments | « no previous file | base/shared_memory_nacl.cc » ('j') | base/shared_memory_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698