summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiu <miu@chromium.org>2015-08-20 15:44:19 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-20 22:44:53 +0000
commit1ed0cbab7569ef9327bab4ebca140df67870a5e3 (patch)
tree0b1475b8afd8c0d467b3e64c42246bc130450821
parentc2b9c2d96f996d263bb197f81968626495bf274f (diff)
downloadchromium_src-1ed0cbab7569ef9327bab4ebca140df67870a5e3.zip
chromium_src-1ed0cbab7569ef9327bab4ebca140df67870a5e3.tar.gz
chromium_src-1ed0cbab7569ef9327bab4ebca140df67870a5e3.tar.bz2
Fix unintended release-build effects in vaapi_wrapper.cc
There are std::map insert and erase operations that will only execute on debug builds. However, these appear to be intended to execute on non-debug builds as well. This change moves expressions outside of the DCHECK(...) to ensure the operations are executed always. TEST=Run Cast streaming on Chromebook Pixel (2013). For example, this can be done by installing the Google Cast Extension from the Chrome Web Store and casting to a Chromecast device. Review URL: https://codereview.chromium.org/1269013002 Cr-Commit-Position: refs/heads/master@{#344602}
-rw-r--r--content/common/gpu/media/vaapi_wrapper.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/content/common/gpu/media/vaapi_wrapper.cc b/content/common/gpu/media/vaapi_wrapper.cc
index 4e26bcc..4f157b7 100644
--- a/content/common/gpu/media/vaapi_wrapper.cc
+++ b/content/common/gpu/media/vaapi_wrapper.cc
@@ -682,7 +682,8 @@ bool VaapiWrapper::CreateCodedBuffer(size_t size, VABufferID* buffer_id) {
buffer_id);
VA_SUCCESS_OR_RETURN(va_res, "Failed to create a coded buffer", false);
- DCHECK(coded_buffers_.insert(*buffer_id).second);
+ const auto is_new_entry = coded_buffers_.insert(*buffer_id).second;
+ DCHECK(is_new_entry);
return true;
}
@@ -931,7 +932,8 @@ bool VaapiWrapper::DownloadAndDestroyCodedBuffer(VABufferID buffer_id,
va_res = vaDestroyBuffer(va_display_, buffer_id);
VA_LOG_ON_ERROR(va_res, "vaDestroyBuffer failed");
- DCHECK(coded_buffers_.erase(buffer_id));
+ const auto was_found = coded_buffers_.erase(buffer_id);
+ DCHECK(was_found);
return buffer_segment == NULL;
}