Chromium Code Reviews| Index: content/common/gpu/client/context_provider_command_buffer.cc |
| diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc |
| index cb827258a5fdf8c271bc0d3eb73874d9a5bc7fe4..9de5a4ea1ada7202717f19540edfc491d03dcd27 100644 |
| --- a/content/common/gpu/client/context_provider_command_buffer.cc |
| +++ b/content/common/gpu/client/context_provider_command_buffer.cc |
| @@ -105,9 +105,6 @@ bool ContextProviderCommandBuffer::BindToCurrentThread() { |
| context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str()); |
| lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); |
| - context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( |
| - base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, |
| - base::Unretained(this))); |
| return true; |
| } |
| @@ -241,6 +238,15 @@ void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( |
| DCHECK(memory_policy_changed_callback_.is_null() || |
| memory_policy_changed_callback.is_null()); |
| memory_policy_changed_callback_ = memory_policy_changed_callback; |
| + |
| + if (memory_policy_changed_callback_.is_null()) { |
| + context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( |
| + CommandBufferProxyImpl::MemoryAllocationChangedCallback()); |
| + } else { |
| + context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( |
|
boliu
2015/08/06 21:13:50
Oh I bet this needs a null check. context3d_->GetC
|
| + base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, |
| + base::Unretained(this))); |
| + } |
| } |
| } // namespace content |