Chromium Code Reviews| Index: content/common/gpu/gpu_command_buffer_stub.cc |
| diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc |
| index 189215122af0bff2aeb71e88d7364c1a7ad0fe21..3f0c69d8fa0c6b661c837871d49e7a41e7e52e97 100644 |
| --- a/content/common/gpu/gpu_command_buffer_stub.cc |
| +++ b/content/common/gpu/gpu_command_buffer_stub.cc |
| @@ -946,6 +946,10 @@ void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer( |
| if (decoder_) { |
| gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| DCHECK(image_manager); |
| + if (image_manager->LookupImage(id)) { |
| + LOG(ERROR) << "Image already exists with same ID."; |
| + return; |
| + } |
| image_manager->AddImage(image.get(), id); |
| } |
| } |
| @@ -956,6 +960,10 @@ void GpuCommandBufferStub::OnDestroyGpuMemoryBuffer(int32 id) { |
| if (decoder_) { |
| gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| DCHECK(image_manager); |
| + if (!image_manager->LookupImage(id)) { |
| + LOG(ERROR) << "Image doesnt exist."; |
|
reveman
2014/07/27 23:58:32
nit: "Image with ID doesn't exist."
sohanjg
2014/07/28 10:15:58
Done.
|
| + return; |
| + } |
| image_manager->RemoveImage(id); |
| } |
| } |