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

Unified Diff: media/audio/sounds/audio_stream_handler.h

Issue 1453233002: Improve input handling for WaveAudioHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: More comments, more test cases. Created 5 years, 1 month 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
Index: media/audio/sounds/audio_stream_handler.h
diff --git a/media/audio/sounds/audio_stream_handler.h b/media/audio/sounds/audio_stream_handler.h
index f814aaef5993b793052fd54bf80105f8c634d57e..2dd77d68e49518af683ce7a32d01ef12cb8fcbb2 100644
--- a/media/audio/sounds/audio_stream_handler.h
+++ b/media/audio/sounds/audio_stream_handler.h
@@ -53,7 +53,8 @@ class MEDIA_EXPORT AudioStreamHandler : public base::NonThreadSafe {
// Stops current playback.
void Stop();
- const WavAudioHandler& wav_audio_handler() const { return wav_audio_; }
+ // If AudioStreamHandler is not initialized, this will return nullptr.
+ const WavAudioHandler* wav_audio_handler() const { return wav_audio_.get(); }
tommi (sloooow) - chröme 2015/11/19 09:44:06 can you add a DCHECK here for the current thread?
slan 2015/11/19 18:57:16 Does this class needs these? All data members are
private:
friend class AudioStreamHandlerTest;
@@ -65,7 +66,7 @@ class MEDIA_EXPORT AudioStreamHandler : public base::NonThreadSafe {
static void SetAudioSourceForTesting(
AudioOutputStream::AudioSourceCallback* source);
- WavAudioHandler wav_audio_;
+ scoped_ptr<WavAudioHandler> wav_audio_;
scoped_ptr<AudioStreamContainer> stream_;
bool initialized_;

Powered by Google App Engine
This is Rietveld 408576698