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

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') | no next file with comments »
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..30b1a892c8c6168fa806e1bfd97bc86ac94de892 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 MapAt(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 MapAt(off_t offset, size_t bytes);
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698