Index: base/memory/discardable_memory_ashmem.h |
diff --git a/base/memory/discardable_memory_ashmem.h b/base/memory/discardable_memory_ashmem.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04b3ade2b5d047937696e5015f5c81392d776d19 |
--- /dev/null |
+++ b/base/memory/discardable_memory_ashmem.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// 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_ |
+ |
+#include "base/memory/discardable_memory.h" |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/discardable_memory_manager.h" |
+ |
+namespace base { |
+namespace internal { |
+ |
+class DiscardableMemoryAshmem : public DiscardableMemory { |
+ public: |
+ explicit DiscardableMemoryAshmem(DiscardableMemoryManager* manager, |
+ size_t size); |
+ virtual ~DiscardableMemoryAshmem(); |
+ |
+ bool Initialize(); |
+ |
+ // DiscardableMemory: |
+ virtual DiscardableMemoryLockStatus Lock() OVERRIDE; |
+ virtual void Unlock() OVERRIDE; |
+ virtual void* Memory() const OVERRIDE; |
+ |
+ private: |
+ DiscardableMemoryManager* const manager_; |
+ DiscardableMemoryManager::AllocationId allocation_id_; |
+ void* memory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAshmem); |
+}; |
+ |
+} // namespace internal |
+} // namespace base |
+ |
+#endif // BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |