Index: base/memory/discardable_memory_shmem.h |
diff --git a/base/memory/discardable_memory_ashmem.h b/base/memory/discardable_memory_shmem.h |
similarity index 54% |
copy from base/memory/discardable_memory_ashmem.h |
copy to base/memory/discardable_memory_shmem.h |
index 392f29004f3a98568d74807e8eed50fb2281ebad..d25f84cb46dbdb364d1a86dbf4c9286c8759d02e 100644 |
--- a/base/memory/discardable_memory_ashmem.h |
+++ b/base/memory/discardable_memory_shmem.h |
@@ -2,30 +2,28 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |
-#define BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |
+#ifndef BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_ |
+#define BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_ |
#include "base/memory/discardable_memory.h" |
-#include "base/macros.h" |
#include "base/memory/discardable_memory_manager.h" |
namespace base { |
-namespace internal { |
+class DiscardableSharedMemory; |
-class DiscardableAshmemChunk; |
-class DiscardableMemoryAshmemAllocator; |
-class DiscardableMemoryManager; |
+namespace internal { |
-class DiscardableMemoryAshmem |
+class DiscardableMemoryShmem |
: public DiscardableMemory, |
public internal::DiscardableMemoryManagerAllocation { |
public: |
- explicit DiscardableMemoryAshmem(size_t bytes, |
- DiscardableMemoryAshmemAllocator* allocator, |
- DiscardableMemoryManager* manager); |
+ explicit DiscardableMemoryShmem(size_t bytes); |
+ virtual ~DiscardableMemoryShmem(); |
+ |
+ static void ReleaseFreeMemory(); |
- virtual ~DiscardableMemoryAshmem(); |
+ static void PurgeForTesting(); |
bool Initialize(); |
@@ -38,18 +36,17 @@ class DiscardableMemoryAshmem |
virtual bool AllocateAndAcquireLock() override; |
virtual void ReleaseLock() override; |
virtual void Purge() override; |
+ virtual bool IsMemoryResident() const override; |
private: |
const size_t bytes_; |
- DiscardableMemoryAshmemAllocator* const allocator_; |
- DiscardableMemoryManager* const manager_; |
+ scoped_ptr<DiscardableSharedMemory> shared_memory_; |
bool is_locked_; |
- scoped_ptr<DiscardableAshmemChunk> ashmem_chunk_; |
- DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAshmem); |
+ DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryShmem); |
}; |
} // namespace internal |
} // namespace base |
-#endif // BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |
+#endif // BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_ |