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

Unified Diff: base/memory/discardable_memory_shmem_allocator.cc

Issue 871043003: base: Improve DiscardableSharedMemory support for ashmem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing return statement Created 5 years, 11 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 | « no previous file | base/memory/discardable_shared_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_shmem_allocator.cc
diff --git a/base/memory/discardable_memory_shmem_allocator.cc b/base/memory/discardable_memory_shmem_allocator.cc
index fdd68673420e84eafe67c5cfc4a90b955eea5714..8abe4569382e8d66f407aba397f296fbd6e17b62 100644
--- a/base/memory/discardable_memory_shmem_allocator.cc
+++ b/base/memory/discardable_memory_shmem_allocator.cc
@@ -18,7 +18,11 @@ class DiscardableMemoryShmemChunkImpl : public DiscardableMemoryShmemChunk {
: shared_memory_(shared_memory.Pass()) {}
// Overridden from DiscardableMemoryShmemChunk:
- bool Lock() override { return shared_memory_->Lock(0, 0); }
+ bool Lock() override {
+ auto result = shared_memory_->Lock(0, 0);
+ DCHECK_NE(result, DiscardableSharedMemory::PURGED);
+ return result == DiscardableSharedMemory::SUCCESS;
+ }
void Unlock() override { shared_memory_->Unlock(0, 0); }
void* Memory() const override { return shared_memory_->memory(); }
bool IsMemoryResident() const override {
« no previous file with comments | « no previous file | base/memory/discardable_shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698