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 { |