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

Unified Diff: base/shared_memory_nacl.cc

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 | « base/shared_memory.h ('k') | base/shared_memory_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory_nacl.cc
diff --git a/base/shared_memory_nacl.cc b/base/shared_memory_nacl.cc
index 433ba285b927af96f94bd71b879e8e1f37c78ca6..63e56e5df9ae5e877df7d957814730f5826f52aa 100644
--- a/base/shared_memory_nacl.cc
+++ b/base/shared_memory_nacl.cc
@@ -84,7 +84,7 @@ bool SharedMemory::Open(const std::string& name, bool read_only) {
return false;
}
-bool SharedMemory::Map(size_t bytes) {
+bool SharedMemory::MapAt(off_t offset, size_t bytes) {
if (mapped_file_ == -1)
return false;
@@ -92,7 +92,7 @@ bool SharedMemory::Map(size_t bytes) {
return false;
memory_ = mmap(NULL, bytes, PROT_READ | (read_only_ ? 0 : PROT_WRITE),
- MAP_SHARED, mapped_file_, 0);
+ MAP_SHARED, mapped_file_, offset);
bool mmap_succeeded = memory_ != MAP_FAILED && memory_ != NULL;
if (mmap_succeeded) {
« no previous file with comments | « base/shared_memory.h ('k') | base/shared_memory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698