OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |
| 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |
| 7 |
| 8 #include "base/memory/discardable_memory.h" |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/memory/discardable_memory_manager.h" |
| 12 |
| 13 namespace base { |
| 14 namespace internal { |
| 15 |
| 16 class DiscardableMemoryAshmem : public DiscardableMemory { |
| 17 public: |
| 18 explicit DiscardableMemoryAshmem(DiscardableMemoryManager* manager, |
| 19 size_t size); |
| 20 virtual ~DiscardableMemoryAshmem(); |
| 21 |
| 22 bool Initialize(); |
| 23 |
| 24 // DiscardableMemory: |
| 25 virtual DiscardableMemoryLockStatus Lock() OVERRIDE; |
| 26 virtual void Unlock() OVERRIDE; |
| 27 virtual void* Memory() const OVERRIDE; |
| 28 |
| 29 private: |
| 30 DiscardableMemoryManager* const manager_; |
| 31 DiscardableMemoryManager::AllocationId allocation_id_; |
| 32 void* memory_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAshmem); |
| 35 }; |
| 36 |
| 37 } // namespace internal |
| 38 } // namespace base |
| 39 |
| 40 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ |
OLD | NEW |