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

Unified Diff: base/memory/discardable_memory_shmem_allocator.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/discardable_memory_shmem_allocator.h ('k') | base/memory/discardable_memory_unittest.cc » ('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 8abe4569382e8d66f407aba397f296fbd6e17b62..761204f31220d043e526f6cb35e3548e6eca237f 100644
--- a/base/memory/discardable_memory_shmem_allocator.cc
+++ b/base/memory/discardable_memory_shmem_allocator.cc
@@ -18,16 +18,12 @@ class DiscardableMemoryShmemChunkImpl : public DiscardableMemoryShmemChunk {
: shared_memory_(shared_memory.Pass()) {}
// Overridden from DiscardableMemoryShmemChunk:
- bool Lock() override {
- auto result = shared_memory_->Lock(0, 0);
- DCHECK_NE(result, DiscardableSharedMemory::PURGED);
- return result == DiscardableSharedMemory::SUCCESS;
+ bool Lock() override { return false; }
+ void Unlock() override {
+ shared_memory_->Unlock(0, 0);
+ shared_memory_.reset();
}
- void Unlock() override { shared_memory_->Unlock(0, 0); }
void* Memory() const override { return shared_memory_->memory(); }
- bool IsMemoryResident() const override {
- return shared_memory_->IsMemoryResident();
- }
private:
scoped_ptr<DiscardableSharedMemory> shared_memory_;
« no previous file with comments | « base/memory/discardable_memory_shmem_allocator.h ('k') | base/memory/discardable_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698