| Index: content/child/child_discardable_shared_memory_manager.h
|
| diff --git a/content/child/child_discardable_shared_memory_manager.h b/content/child/child_discardable_shared_memory_manager.h
|
| index e35c57b4a269bad65805a281596e45eb024feb5e..aefd2644444e34b2413c61a13c1ecff024f8f241 100644
|
| --- a/content/child/child_discardable_shared_memory_manager.h
|
| +++ b/content/child/child_discardable_shared_memory_manager.h
|
| @@ -7,7 +7,9 @@
|
|
|
| #include "base/memory/discardable_memory_shmem_allocator.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/synchronization/lock.h"
|
| #include "content/child/thread_safe_sender.h"
|
| +#include "content/common/discardable_shared_memory_heap.h"
|
|
|
| namespace content {
|
|
|
| @@ -20,10 +22,20 @@ class ChildDiscardableSharedMemoryManager
|
| ~ChildDiscardableSharedMemoryManager() override;
|
|
|
| // Overridden from base::DiscardableMemoryShmemAllocator:
|
| - scoped_ptr<base::DiscardableSharedMemory>
|
| - AllocateLockedDiscardableSharedMemory(size_t size) override;
|
| + scoped_ptr<base::DiscardableMemoryShmemChunk> AllocateLockedDiscardableMemory(
|
| + size_t size) override;
|
| +
|
| + bool LockSpan(DiscardableSharedMemoryHeap::Span* span);
|
| + void UnlockSpan(DiscardableSharedMemoryHeap::Span* span);
|
| + bool IsSpanResident(DiscardableSharedMemoryHeap::Span* span) const;
|
| + void ReleaseSpan(scoped_ptr<DiscardableSharedMemoryHeap::Span> span);
|
|
|
| private:
|
| + scoped_ptr<base::DiscardableSharedMemory>
|
| + AllocateLockedDiscardableSharedMemory(size_t size);
|
| +
|
| + mutable base::Lock lock_;
|
| + DiscardableSharedMemoryHeap heap_;
|
| scoped_refptr<ThreadSafeSender> sender_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ChildDiscardableSharedMemoryManager);
|
|
|