Chromium Code Reviews| 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 | |
| 12 class DiscardableMemoryEmulated : public DiscardableMemory { | |
|
Philippe
2013/12/11 08:56:27
Should we have this in base::internal?
reveman
2013/12/12 06:54:23
Done.
| |
| 13 public: | |
| 14 explicit DiscardableMemoryEmulated(size_t size); | |
| 15 virtual ~DiscardableMemoryEmulated(); | |
| 16 | |
| 17 static void PurgeForTesting(); | |
| 18 | |
| 19 bool Initialize(); | |
|
Philippe
2013/12/11 08:56:27
Just a suggestion, feel free to ignore :)
I see t
reveman
2013/12/12 06:54:23
I prefer to avoid static Create functions when pos
Philippe
2013/12/12 08:53:35
Fair enough, I would tend to avoid such inheritanc
reveman
2013/12/12 16:25:16
Composition can definitely make more sense in some
| |
| 20 | |
| 21 // Overridden from DiscardableMemory: | |
| 22 virtual LockDiscardableMemoryStatus Lock() OVERRIDE; | |
| 23 virtual void Unlock() OVERRIDE; | |
| 24 virtual void* Memory() const OVERRIDE; | |
| 25 | |
| 26 private: | |
| 27 scoped_ptr<uint8, FreeDeleter> memory_; | |
| 28 bool is_locked_; | |
| 29 | |
| 30 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryEmulated); | |
| 31 }; | |
| 32 | |
| 33 } // namespace base | |
| 34 | |
| 35 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_ | |
| OLD | NEW |