Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Unified Diff: base/memory/discardable_memory_shmem_allocator.h

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/discardable_memory_shmem.cc ('k') | base/memory/discardable_memory_shmem_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_shmem_allocator.h
diff --git a/base/memory/discardable_memory_shmem_allocator.h b/base/memory/discardable_memory_shmem_allocator.h
index 68624b3960b3c979dd9989850361b93b12157f77..ed40672151849313aff651390c94e0992099a1fe 100644
--- a/base/memory/discardable_memory_shmem_allocator.h
+++ b/base/memory/discardable_memory_shmem_allocator.h
@@ -9,7 +9,18 @@
#include "base/memory/scoped_ptr.h"
namespace base {
-class DiscardableSharedMemory;
+
+// TODO(reveman): Remove this by having allocator interface return
+// real DiscardableMemory instances. crbug.com/442945
+class BASE_EXPORT DiscardableMemoryShmemChunk {
+ public:
+ virtual ~DiscardableMemoryShmemChunk() {}
+
+ virtual bool Lock() = 0;
+ virtual void Unlock() = 0;
+ virtual void* Memory() const = 0;
+ virtual bool IsMemoryResident() const = 0;
+};
class BASE_EXPORT DiscardableMemoryShmemAllocator {
public:
@@ -20,8 +31,8 @@ class BASE_EXPORT DiscardableMemoryShmemAllocator {
// Ownership of |instance| remains with the caller.
static void SetInstance(DiscardableMemoryShmemAllocator* allocator);
- virtual scoped_ptr<DiscardableSharedMemory>
- AllocateLockedDiscardableSharedMemory(size_t size) = 0;
+ virtual scoped_ptr<DiscardableMemoryShmemChunk>
+ AllocateLockedDiscardableMemory(size_t size) = 0;
protected:
virtual ~DiscardableMemoryShmemAllocator() {}
« no previous file with comments | « base/memory/discardable_memory_shmem.cc ('k') | base/memory/discardable_memory_shmem_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698