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

Unified Diff: media/audio/audio_streams_tracker.cc

Issue 2655413004: Strip out stream counting from AudioRendererHost. (Closed)
Patch Set: Add moar DCHECKs. Created 3 years, 10 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 | « media/audio/audio_streams_tracker.h ('k') | media/audio/audio_streams_tracker_unittest.cc » ('j') | 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
deleted file mode 100644
index 5363796df737f3667923479b192ddc709730c1a5..0000000000000000000000000000000000000000
--- a/media/audio/audio_streams_tracker.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "media/audio/audio_streams_tracker.h"
-
-#include <limits>
-
-namespace media {
-
-AudioStreamsTracker::AudioStreamsTracker()
- : current_stream_count_(0), max_stream_count_(0) {
- thread_checker_.DetachFromThread();
-}
-
-AudioStreamsTracker::~AudioStreamsTracker() {
- DCHECK_EQ(current_stream_count_, 0u);
-}
-
-void AudioStreamsTracker::IncreaseStreamCount() {
- DCHECK(thread_checker_.CalledOnValidThread());
- 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(size_t count) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK_GE(current_stream_count_, count);
- current_stream_count_ -= count;
-}
-
-void AudioStreamsTracker::ResetMaxStreamCount() {
- DCHECK(thread_checker_.CalledOnValidThread());
- max_stream_count_ = current_stream_count_;
-}
-
-size_t AudioStreamsTracker::max_stream_count() const {
- DCHECK(thread_checker_.CalledOnValidThread());
- return max_stream_count_;
-}
-
-} // namespace media
« no previous file with comments | « media/audio/audio_streams_tracker.h ('k') | media/audio/audio_streams_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698