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

Unified Diff: content/renderer/media/media_stream_audio_source.h

Issue 2416123002: Stop media stream source when audio capture error occurs. (Closed)
Patch Set: Fix unit tests. Created 4 years, 2 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
Index: content/renderer/media/media_stream_audio_source.h
diff --git a/content/renderer/media/media_stream_audio_source.h b/content/renderer/media/media_stream_audio_source.h
index 235227189090955df93ef26a83f749be91ed1bc3..485f1a1278683df52dd0d50275ef6e672652f06f 100644
--- a/content/renderer/media/media_stream_audio_source.h
+++ b/content/renderer/media/media_stream_audio_source.h
@@ -17,6 +17,10 @@
#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace content {
class MediaStreamAudioTrack;
@@ -123,6 +127,9 @@ class CONTENT_EXPORT MediaStreamAudioSource
void DeliverDataToTracks(const media::AudioBus& audio_bus,
base::TimeTicks reference_time);
+ // Called by subclasses when capture error occurs.
miu 2016/10/19 22:43:22 Please add: // Note: This can be called on any t
xjz 2016/10/19 23:59:36 Done.
+ void OnAudioCaptureError(const std::string& why);
miu 2016/10/19 22:43:22 naming nit (says what it does more accurately): St
xjz 2016/10/19 23:59:36 Done.
+
private:
// MediaStreamSource override.
void DoStopSource() final;
@@ -146,6 +153,8 @@ class CONTENT_EXPORT MediaStreamAudioSource
// Manages tracks connected to this source and the audio format and data flow.
MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_;
+ const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
miu 2016/10/19 22:43:22 Please add comment (mostly the same as the one for
xjz 2016/10/19 23:59:36 Done.
+
// Provides weak pointers so that MediaStreamAudioTracks won't call
// StopAudioDeliveryTo() if this instance dies first.
base::WeakPtrFactory<MediaStreamAudioSource> weak_factory_;
« no previous file with comments | « content/renderer/media/local_media_stream_audio_source.cc ('k') | content/renderer/media/media_stream_audio_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698