Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 gfx::Size size = buffer_it->second.size; | 394 gfx::Size size = buffer_it->second.size; |
| 395 gfx::BufferFormat format = buffer_it->second.format; | 395 gfx::BufferFormat format = buffer_it->second.format; |
| 396 gfx::BufferUsage usage = buffer_it->second.usage; | 396 gfx::BufferUsage usage = buffer_it->second.usage; |
| 397 // Remove the buffer entry and call CreateGpuMemoryBufferOnIO again. | 397 // Remove the buffer entry and call CreateGpuMemoryBufferOnIO again. |
| 398 buffers.erase(buffer_it); | 398 buffers.erase(buffer_it); |
| 399 CreateGpuMemoryBufferOnIO(id, size, format, usage, surface_handle, | 399 CreateGpuMemoryBufferOnIO(id, size, format, usage, surface_handle, |
| 400 client_id, callback); | 400 client_id, callback); |
| 401 } else { | 401 } else { |
| 402 // Remove the buffer entry and run the allocation callback with an empty | 402 // Remove the buffer entry and run the allocation callback with an empty |
| 403 // handle to indicate failure. | 403 // handle to indicate failure. |
| 404 LOG(ERROR) << "GpuMemoryBuffer ID is mismatched. request id:" << id.id | |
|
reveman
2017/05/30 18:11:52
We don't know if it's because a id mismatch here.
dshwang
2017/05/30 18:52:57
It happens when handle.id != id. please check abov
| |
| 405 << ", response id:" << handle.id.id; | |
| 404 buffers.erase(buffer_it); | 406 buffers.erase(buffer_it); |
| 405 callback.Run(gfx::GpuMemoryBufferHandle()); | 407 callback.Run(gfx::GpuMemoryBufferHandle()); |
| 406 } | 408 } |
| 407 return; | 409 return; |
| 408 } | 410 } |
| 409 | 411 |
| 410 // Store the type and host id of this buffer so it can be cleaned up if the | 412 // Store the type and host id of this buffer so it can be cleaned up if the |
| 411 // client is removed. | 413 // client is removed. |
| 412 buffer_it->second.type = handle.type; | 414 buffer_it->second.type = handle.type; |
| 413 buffer_it->second.gpu_host_id = gpu_host_id; | 415 buffer_it->second.gpu_host_id = gpu_host_id; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 format(format), | 472 format(format), |
| 471 usage(usage), | 473 usage(usage), |
| 472 gpu_host_id(gpu_host_id) {} | 474 gpu_host_id(gpu_host_id) {} |
| 473 | 475 |
| 474 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = | 476 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = |
| 475 default; | 477 default; |
| 476 | 478 |
| 477 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} | 479 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} |
| 478 | 480 |
| 479 } // namespace content | 481 } // namespace content |
| OLD | NEW |