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

Unified Diff: mojo/system/raw_shared_buffer_posix.cc

Issue 471773002: Mojo: Add a platform interface for shared memory (embedder::PlatformSharedBuffer). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 6 years, 4 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 | « mojo/system/raw_shared_buffer.cc ('k') | mojo/system/raw_shared_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/raw_shared_buffer_posix.cc
diff --git a/mojo/system/raw_shared_buffer_posix.cc b/mojo/system/raw_shared_buffer_posix.cc
index 779bcd6cb025630c15a57118029ef1575f1b6552..4a4e8cda5d64a94ef513dfb5acf942e456ef18d7 100644
--- a/mojo/system/raw_shared_buffer_posix.cc
+++ b/mojo/system/raw_shared_buffer_posix.cc
@@ -115,8 +115,9 @@ bool RawSharedBuffer::InitFromPlatformHandle(
return true;
}
-scoped_ptr<RawSharedBufferMapping> RawSharedBuffer::MapImpl(size_t offset,
- size_t length) {
+scoped_ptr<embedder::PlatformSharedBufferMapping> RawSharedBuffer::MapImpl(
+ size_t offset,
+ size_t length) {
size_t offset_rounding = offset % base::SysInfo::VMAllocationGranularity();
size_t real_offset = offset - offset_rounding;
size_t real_length = length + offset_rounding;
@@ -136,11 +137,11 @@ scoped_ptr<RawSharedBufferMapping> RawSharedBuffer::MapImpl(size_t offset,
// return null either.
if (real_base == MAP_FAILED || !real_base) {
PLOG(ERROR) << "mmap";
- return scoped_ptr<RawSharedBufferMapping>();
+ return scoped_ptr<embedder::PlatformSharedBufferMapping>();
}
void* base = static_cast<char*>(real_base) + offset_rounding;
- return make_scoped_ptr(
+ return scoped_ptr<embedder::PlatformSharedBufferMapping>(
new RawSharedBufferMapping(base, length, real_base, real_length));
}
« no previous file with comments | « mojo/system/raw_shared_buffer.cc ('k') | mojo/system/raw_shared_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698