Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 195973002: Change DCHECK_IS_ON() to DCHECK_IS_ON (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep a comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/logging_native_handler.cc ('k') | content/renderer/media/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/gpu_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index 9ec813983645bef94c86d0470861d9c00ce2ecae..755563e5727a90899cf946d2b88c8d10cf8b50ae 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -55,26 +55,16 @@ static bool MakeDecoderContextCurrent(
return true;
}
-// A helper class that works like AutoLock but only acquires the lock when
+// DebugAutoLock works like AutoLock but only acquires the lock when
// DCHECK is on.
+#if DCHECK_IS_ON
+typedef base::AutoLock DebugAutoLock;
+#else
class DebugAutoLock {
public:
- explicit DebugAutoLock(base::Lock& lock) : lock_(lock) {
- if (DCHECK_IS_ON())
- lock_.Acquire();
- }
-
- ~DebugAutoLock() {
- if (DCHECK_IS_ON()) {
- lock_.AssertAcquired();
- lock_.Release();
- }
- }
-
- private:
- base::Lock& lock_;
- DISALLOW_COPY_AND_ASSIGN(DebugAutoLock);
+ explicit DebugAutoLock(base::Lock&) {}
};
+#endif
class GpuVideoDecodeAccelerator::MessageFilter
: public IPC::ChannelProxy::MessageFilter {
@@ -213,10 +203,8 @@ void GpuVideoDecodeAccelerator::PictureReady(
SetTextureCleared(picture);
} else {
DCHECK(io_message_loop_->BelongsToCurrentThread());
- if (DCHECK_IS_ON()) {
- DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
- DCHECK_EQ(0u, uncleared_textures_.count(picture.picture_buffer_id()));
- }
+ DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
+ DCHECK_EQ(0u, uncleared_textures_.count(picture.picture_buffer_id()));
}
if (!Send(new AcceleratedVideoDecoderHostMsg_PictureReady(
« no previous file with comments | « chrome/renderer/extensions/logging_native_handler.cc ('k') | content/renderer/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698