Commit bd73c938 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Allow missing entries in ClientDiscardableTextureManager::LockTexture

LockTexture currently crashes if a texture is not found. This can
happen when initialization of a discardable texture fails, and should
be handled gracefully rather than crashing.

R=khushalsagar

Bug: 866808
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ia920e7ee649a30f550e968d4e8350f40e77f84b1
Reviewed-on: https://chromium-review.googlesource.com/1148684
Commit-Queue: Eric Karl <ericrk@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577641}
parent 6abe3381
...@@ -35,7 +35,9 @@ ClientDiscardableHandle ClientDiscardableTextureManager::InitializeTexture( ...@@ -35,7 +35,9 @@ ClientDiscardableHandle ClientDiscardableTextureManager::InitializeTexture(
bool ClientDiscardableTextureManager::LockTexture(uint32_t texture_id) { bool ClientDiscardableTextureManager::LockTexture(uint32_t texture_id) {
base::AutoLock hold(lock_); base::AutoLock hold(lock_);
auto found = texture_entries_.find(texture_id); auto found = texture_entries_.find(texture_id);
DCHECK(found != texture_entries_.end()); if (found == texture_entries_.end())
return false;
TextureEntry& entry = found->second; TextureEntry& entry = found->second;
if (!discardable_manager_.LockHandle(entry.id)) { if (!discardable_manager_.LockHandle(entry.id)) {
DCHECK_EQ(0u, entry.client_lock_count); DCHECK_EQ(0u, entry.client_lock_count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment