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

Unified Diff: media/audio/audio_streams_tracker.cc

Issue 2443573003: Factor out AudioOutputDelegate from AudioRendererHost. (Closed)
Patch Set: Final comments addressed. Created 4 years 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 | « media/audio/audio_streams_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_streams_tracker.cc
diff --git a/media/audio/audio_streams_tracker.cc b/media/audio/audio_streams_tracker.cc
index 97b01ca2751743e1ce51d24b28957d551807091b..5363796df737f3667923479b192ddc709730c1a5 100644
--- a/media/audio/audio_streams_tracker.cc
+++ b/media/audio/audio_streams_tracker.cc
@@ -4,6 +4,8 @@
#include "media/audio/audio_streams_tracker.h"
+#include <limits>
+
namespace media {
AudioStreamsTracker::AudioStreamsTracker()
@@ -17,16 +19,16 @@ AudioStreamsTracker::~AudioStreamsTracker() {
void AudioStreamsTracker::IncreaseStreamCount() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK_NE(current_stream_count_, SIZE_MAX);
+ DCHECK_NE(current_stream_count_, std::numeric_limits<size_t>::max());
++current_stream_count_;
if (current_stream_count_ > max_stream_count_)
max_stream_count_ = current_stream_count_;
}
-void AudioStreamsTracker::DecreaseStreamCount() {
+void AudioStreamsTracker::DecreaseStreamCount(size_t count) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK_NE(current_stream_count_, 0u);
- --current_stream_count_;
+ DCHECK_GE(current_stream_count_, count);
+ current_stream_count_ -= count;
}
void AudioStreamsTracker::ResetMaxStreamCount() {
« no previous file with comments | « media/audio/audio_streams_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698