Chromium Code Reviews| Index: base/memory/discardable_memory.h |
| diff --git a/base/memory/discardable_memory.h b/base/memory/discardable_memory.h |
| index c6a8d82da72363d3dc2cecbb01547eeb64c226eb..e87476194aa892e0cb5039698cd4a3c17abd0733 100644 |
| --- a/base/memory/discardable_memory.h |
| +++ b/base/memory/discardable_memory.h |
| @@ -44,6 +44,8 @@ enum LockDiscardableMemoryStatus { |
| // - Mac: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/mac/PurgeableBufferMac.cpp |
| // the comment starting with "vm_object_purgable_control" at |
| // http://www.opensource.apple.com/source/xnu/xnu-792.13.8/osfmk/vm/vm_object.c |
| +// |
| +// Thread-safety: DiscardableMemory instances are not thread-safe. |
| class BASE_EXPORT DiscardableMemory { |
| public: |
| virtual ~DiscardableMemory() {} |
| @@ -53,6 +55,10 @@ class BASE_EXPORT DiscardableMemory { |
| static scoped_ptr<DiscardableMemory> CreateLockedMemory(size_t size); |
| + // Returns the memory's actual size that is greater or equal than the |
|
willchan no longer on Chromium
2013/10/28 19:54:05
Can you explain why this is an important API to ad
willchan no longer on Chromium
2013/11/18 14:53:13
Can you answer this question?
Philippe
2013/11/18 16:34:51
Yes, sorry. I added this mainly to simplify testin
|
| + // size requested at construction. |
| + virtual size_t Size() const = 0; |
| + |
| // Locks the memory so that it will not be purged by the system. Returns |
| // DISCARDABLE_MEMORY_SUCCESS on success. If the return value is |
| // DISCARDABLE_MEMORY_FAILED then this object should be discarded and |