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

Unified Diff: mojo/edk/embedder/simple_platform_shared_buffer_posix.cc

Issue 1350183002: EDK: More scoped_ptr -> std::unique_ptr conversions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: gah Created 5 years, 3 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
Index: mojo/edk/embedder/simple_platform_shared_buffer_posix.cc
diff --git a/mojo/edk/embedder/simple_platform_shared_buffer_posix.cc b/mojo/edk/embedder/simple_platform_shared_buffer_posix.cc
index 613919d5678f0cc5827772ddffe8fd4bd8fc61af..ca3f01303d1cdb83cd22c6c9dd491bbe3f8efab3 100644
--- a/mojo/edk/embedder/simple_platform_shared_buffer_posix.cc
+++ b/mojo/edk/embedder/simple_platform_shared_buffer_posix.cc
@@ -120,9 +120,8 @@ bool SimplePlatformSharedBuffer::InitFromPlatformHandle(
#endif // !defined(OS_ANDROID)
-scoped_ptr<PlatformSharedBufferMapping> SimplePlatformSharedBuffer::MapImpl(
- size_t offset,
- size_t length) {
+std::unique_ptr<PlatformSharedBufferMapping>
+SimplePlatformSharedBuffer::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;
@@ -143,8 +142,11 @@ scoped_ptr<PlatformSharedBufferMapping> SimplePlatformSharedBuffer::MapImpl(
}
void* base = static_cast<char*>(real_base) + offset_rounding;
- return make_scoped_ptr(new SimplePlatformSharedBufferMapping(
- base, length, real_base, real_length));
+ // Note: We can't use |MakeUnique| here, since it's not a friend of
+ // |SimplePlatformSharedBufferMapping| (only we are).
+ return std::unique_ptr<SimplePlatformSharedBufferMapping>(
+ new SimplePlatformSharedBufferMapping(base, length, real_base,
+ real_length));
}
// SimplePlatformSharedBufferMapping -------------------------------------------
« no previous file with comments | « mojo/edk/embedder/simple_platform_shared_buffer.cc ('k') | mojo/edk/embedder/simple_platform_shared_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698