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

Unified Diff: base/memory/shared_memory_android.cc

Issue 2875453002: Add a size parameter to SharedMemoryHandle. (Closed)
Patch Set: Remove extraneous period. Created 3 years, 7 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/memory/shared_memory.h ('k') | base/memory/shared_memory_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_android.cc
diff --git a/base/memory/shared_memory_android.cc b/base/memory/shared_memory_android.cc
index da3c5953f044c8ca861427f7cecfd3661b60f930..4befe06310a32e3af8fa31f91659405d5db6ba16 100644
--- a/base/memory/shared_memory_android.cc
+++ b/base/memory/shared_memory_android.cc
@@ -27,7 +27,7 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
int fd = ashmem_create_region(
options.name_deprecated == NULL ? "" : options.name_deprecated->c_str(),
options.size);
- shm_ = SharedMemoryHandle::ImportHandle(fd);
+ shm_ = SharedMemoryHandle::ImportHandle(fd, options.size);
if (!shm_.IsValid()) {
DLOG(ERROR) << "Shared memory creation failed";
return false;
@@ -42,8 +42,7 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
// Android doesn't appear to have a way to drop write access on an ashmem
// segment for a single descriptor. http://crbug.com/320865
- readonly_shm_ = SharedMemoryHandle(
- base::FileDescriptor(dup(shm_.GetHandle()), false), shm_.GetGUID());
+ readonly_shm_ = shm_.Duplicate();
if (!readonly_shm_.IsValid()) {
DPLOG(ERROR) << "dup() failed";
return false;
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698