Index: content/common/gpu/client/command_buffer_proxy_impl.cc |
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc |
index 4ae3741fcd762886d572b06e2bd2f56ed776f027..c7af757e2742159049aff97a8044facd189623a5 100644 |
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc |
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc |
@@ -72,6 +72,8 @@ bool CommandBufferProxyImpl::OnMessageReceived(const IPC::Message& message) { |
IPC_BEGIN_MESSAGE_MAP(CommandBufferProxyImpl, message) |
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Destroyed, OnDestroyed); |
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ConsoleMsg, OnConsoleMessage); |
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetMemoryAllocation, |
+ OnSetMemoryAllocation); |
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalAck, |
OnSignalAck); |
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SwapBuffersCompleted, |
@@ -130,6 +132,17 @@ void CommandBufferProxyImpl::OnConsoleMessage( |
} |
} |
+void CommandBufferProxyImpl::SetMemoryAllocationChangedCallback( |
+ const MemoryAllocationChangedCallback& callback) { |
+ CheckLock(); |
+ if (last_state_.error != gpu::error::kNoError) |
+ return; |
+ |
+ memory_allocation_changed_callback_ = callback; |
+ Send(new GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback( |
+ route_id_, !memory_allocation_changed_callback_.is_null())); |
+} |
+ |
void CommandBufferProxyImpl::AddDeletionObserver(DeletionObserver* observer) { |
scoped_ptr<base::AutoLock> lock; |
if (lock_) |
@@ -145,6 +158,12 @@ void CommandBufferProxyImpl::RemoveDeletionObserver( |
deletion_observers_.RemoveObserver(observer); |
} |
+void CommandBufferProxyImpl::OnSetMemoryAllocation( |
+ const gpu::MemoryAllocation& allocation) { |
+ if (!memory_allocation_changed_callback_.is_null()) |
+ memory_allocation_changed_callback_.Run(allocation); |
+} |
+ |
void CommandBufferProxyImpl::OnSignalAck(uint32 id) { |
SignalTaskMap::iterator it = signal_tasks_.find(id); |
DCHECK(it != signal_tasks_.end()); |