Index: content/common/host_discardable_shared_memory_manager.cc |
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc |
index 3d2be9d22c1e32bcad935e4cc8694b60e1282df7..d84529ac8889948cd4ce7116e95797795d8f40c5 100644 |
--- a/content/common/host_discardable_shared_memory_manager.cc |
+++ b/content/common/host_discardable_shared_memory_manager.cc |
@@ -9,6 +9,7 @@ |
#include "base/callback.h" |
#include "base/debug/crash_logging.h" |
#include "base/lazy_instance.h" |
+#include "base/memory/discardable_memory.h" |
#include "base/numerics/safe_math.h" |
#include "base/profiler/scoped_tracker.h" |
#include "base/strings/string_number_conversions.h" |
@@ -18,19 +19,18 @@ |
namespace content { |
namespace { |
-class DiscardableMemoryShmemChunkImpl |
- : public base::DiscardableMemoryShmemChunk { |
+class DiscardableMemoryImpl : public base::DiscardableMemory { |
public: |
- explicit DiscardableMemoryShmemChunkImpl( |
+ explicit DiscardableMemoryImpl( |
scoped_ptr<base::DiscardableSharedMemory> shared_memory) |
: shared_memory_(shared_memory.Pass()), is_locked_(true) {} |
- ~DiscardableMemoryShmemChunkImpl() override { |
+ ~DiscardableMemoryImpl() override { |
if (is_locked_) |
shared_memory_->Unlock(0, 0); |
shared_memory_->Purge(base::Time::Now()); |
} |
- // Overridden from base::DiscardableMemoryShmemChunk: |
+ // Overridden from base::DiscardableMemory: |
bool Lock() override { |
DCHECK(!is_locked_); |
@@ -55,7 +55,7 @@ class DiscardableMemoryShmemChunkImpl |
scoped_ptr<base::DiscardableSharedMemory> shared_memory_; |
bool is_locked_; |
- DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryShmemChunkImpl); |
+ DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryImpl); |
}; |
base::LazyInstance<HostDiscardableSharedMemoryManager> |
@@ -98,7 +98,7 @@ HostDiscardableSharedMemoryManager::current() { |
return g_discardable_shared_memory_manager.Pointer(); |
} |
-scoped_ptr<base::DiscardableMemoryShmemChunk> |
+scoped_ptr<base::DiscardableMemory> |
HostDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory( |
size_t size) { |
// Note: Use DiscardableSharedMemoryHeap for in-process allocation |
@@ -110,7 +110,7 @@ HostDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory( |
scoped_ptr<base::DiscardableSharedMemory> memory( |
new base::DiscardableSharedMemory(handle)); |
CHECK(memory->Map(size)); |
- return make_scoped_ptr(new DiscardableMemoryShmemChunkImpl(memory.Pass())); |
+ return make_scoped_ptr(new DiscardableMemoryImpl(memory.Pass())); |
} |
void HostDiscardableSharedMemoryManager:: |