OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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_EMULATED_H_ |
| 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_ |
| 7 |
| 8 #include "base/memory/discardable_memory.h" |
| 9 |
| 10 namespace base { |
| 11 namespace internal { |
| 12 |
| 13 class DiscardableMemoryEmulated : public DiscardableMemory { |
| 14 public: |
| 15 explicit DiscardableMemoryEmulated(size_t size); |
| 16 virtual ~DiscardableMemoryEmulated(); |
| 17 |
| 18 static void PurgeForTesting(); |
| 19 |
| 20 bool Initialize(); |
| 21 |
| 22 // Overridden from DiscardableMemory: |
| 23 virtual LockDiscardableMemoryStatus Lock() OVERRIDE; |
| 24 virtual void Unlock() OVERRIDE; |
| 25 virtual void* Memory() const OVERRIDE; |
| 26 |
| 27 private: |
| 28 scoped_ptr<uint8, FreeDeleter> memory_; |
| 29 bool is_locked_; |
| 30 |
| 31 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryEmulated); |
| 32 }; |
| 33 |
| 34 } // namespace internal |
| 35 } // namespace base |
| 36 |
| 37 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_ |
OLD | NEW |