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

Unified Diff: base/memory/shared_memory_android.cc

Issue 2845113005: Replace base::SharedMemory read-only methods with GetReadOnlyHandle. (Closed)
Patch Set: Comments from thakis. Created 3 years, 8 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_helper.cc » ('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 49289f704b392d2e15ef594bdd11e83f140ead9f..ad9145fcdf1033a7429625aca56318c759253b20 100644
--- a/base/memory/shared_memory_android.cc
+++ b/base/memory/shared_memory_android.cc
@@ -42,8 +42,8 @@ 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_mapped_file_ = dup(shm_.GetHandle());
- if (-1 == readonly_mapped_file_) {
+ readonly_shm_ = SharedMemoryHandle::ImportHandle(dup(shm_.GetHandle()));
+ 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_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698