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

Unified Diff: base/shared_memory_win.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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory_win.cc
diff --git a/base/shared_memory_win.cc b/base/shared_memory_win.cc
index 877ccd76e3310370b0394f196cbb6bee9290c581..f64e3c8978f9e139a7216095ec7b217b68f09d3e 100644
--- a/base/shared_memory_win.cc
+++ b/base/shared_memory_win.cc
@@ -134,7 +134,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_ == NULL)
return false;
@@ -142,7 +142,10 @@ bool SharedMemory::Map(size_t bytes) {
return false;
memory_ = MapViewOfFile(mapped_file_,
- read_only_ ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS, 0, 0, bytes);
+ read_only_ ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS,
+ static_cast<uint64>(offset) >> 32,
+ static_cast<DWORD>(offset),
+ bytes);
if (memory_ != NULL) {
DCHECK_EQ(0U, reinterpret_cast<uintptr_t>(memory_) &
(SharedMemory::MAP_MINIMUM_ALIGNMENT - 1));
« no previous file with comments | « base/shared_memory_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698