Index: gpu/command_buffer/client/mapped_memory.cc |
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc |
index aeab0801aa3ea6b0c93d5856d1aadc062d13db67..b62ca27e4bf7a103b7527e1bb16cc16a01faf7c1 100644 |
--- a/gpu/command_buffer/client/mapped_memory.cc |
+++ b/gpu/command_buffer/client/mapped_memory.cc |
@@ -15,17 +15,20 @@ namespace gpu { |
MemoryChunk::MemoryChunk(int32 shm_id, |
scoped_refptr<gpu::Buffer> shm, |
- CommandBufferHelper* helper) |
+ CommandBufferHelper* helper, |
+ const base::Closure& poll_callback) |
: shm_id_(shm_id), |
shm_(shm), |
- allocator_(shm->size(), helper, shm->memory()) {} |
+ allocator_(shm->size(), helper, poll_callback, shm->memory()) {} |
MemoryChunk::~MemoryChunk() {} |
MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper, |
+ const base::Closure& poll_callback, |
size_t unused_memory_reclaim_limit) |
: chunk_size_multiple_(1), |
helper_(helper), |
+ poll_callback_(poll_callback), |
allocated_memory_(0), |
max_free_bytes_(unused_memory_reclaim_limit) { |
} |
@@ -88,7 +91,7 @@ void* MappedMemoryManager::Alloc( |
cmd_buf->CreateTransferBuffer(chunk_size, &id); |
if (id < 0) |
return NULL; |
- MemoryChunk* mc = new MemoryChunk(id, shm, helper_); |
+ MemoryChunk* mc = new MemoryChunk(id, shm, helper_, poll_callback_); |
allocated_memory_ += mc->GetSize(); |
chunks_.push_back(mc); |
void* mem = mc->Alloc(size); |