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

Unified Diff: mojo/system/raw_shared_buffer_posix.cc

Issue 219023010: Mojo: RawSharedBuffer::Mapping -> RawSharedBufferMapping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 6 years, 9 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 bded0e446778bc5a2793f1a5854fa7a680e61a0d..3ce50f040b707c4d823d2dca731af36671c5a2b9 100644
--- a/mojo/system/raw_shared_buffer_posix.cc
+++ b/mojo/system/raw_shared_buffer_posix.cc
@@ -30,13 +30,6 @@ COMPILE_ASSERT(sizeof(off_t) <= sizeof(uint64_t), off_t_too_big);
namespace mojo {
namespace system {
-// RawSharedBuffer::Mapping ----------------------------------------------------
-
-void RawSharedBuffer::Mapping::Unmap() {
- int result = munmap(real_base_, real_length_);
- PLOG_IF(ERROR, result != 0) << "munmap";
-}
-
// RawSharedBuffer -------------------------------------------------------------
bool RawSharedBuffer::InitNoLock() {
@@ -89,7 +82,7 @@ bool RawSharedBuffer::InitNoLock() {
return true;
}
-scoped_ptr<RawSharedBuffer::Mapping> RawSharedBuffer::MapImplNoLock(
+scoped_ptr<RawSharedBufferMapping> RawSharedBuffer::MapImplNoLock(
size_t offset,
size_t length) {
lock_.AssertAcquired();
@@ -109,11 +102,19 @@ scoped_ptr<RawSharedBuffer::Mapping> RawSharedBuffer::MapImplNoLock(
// return null either.
if (real_base == MAP_FAILED || !real_base) {
PLOG(ERROR) << "mmap";
- return scoped_ptr<Mapping>();
+ return scoped_ptr<RawSharedBufferMapping>();
}
void* base = static_cast<char*>(real_base) + offset_rounding;
- return make_scoped_ptr(new Mapping(base, length, real_base, real_length));
+ return make_scoped_ptr(
+ new RawSharedBufferMapping(base, length, real_base, real_length));
+}
+
+// RawSharedBufferMapping ------------------------------------------------------
+
+void RawSharedBufferMapping::Unmap() {
+ int result = munmap(real_base_, real_length_);
+ PLOG_IF(ERROR, result != 0) << "munmap";
}
} // namespace system
« 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