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

Unified Diff: content/browser/renderer_host/media/media_stream_track_metrics_host.cc

Issue 411903002: Fixed the crash when adding a chromium sink to remote audio track or (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed the comments. Created 6 years, 5 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 | « no previous file | content/public/renderer/media_stream_audio_sink.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_stream_track_metrics_host.cc
diff --git a/content/browser/renderer_host/media/media_stream_track_metrics_host.cc b/content/browser/renderer_host/media/media_stream_track_metrics_host.cc
index 9bae1f728392d8a99c5f5399a7e398021649e45e..328d60e28acf2cd49864f87ad997faa72aebfcb5 100644
--- a/content/browser/renderer_host/media/media_stream_track_metrics_host.cc
+++ b/content/browser/renderer_host/media/media_stream_track_metrics_host.cc
@@ -49,13 +49,16 @@ bool MediaStreamTrackMetricsHost::OnMessageReceived(
void MediaStreamTrackMetricsHost::OnAddTrack(uint64 id,
bool is_audio,
bool is_remote) {
- DCHECK(tracks_.find(id) == tracks_.end());
+ if (tracks_.find(id) != tracks_.end())
+ return;
+
TrackInfo info = {is_audio, is_remote, base::TimeTicks::Now()};
tracks_[id] = info;
}
void MediaStreamTrackMetricsHost::OnRemoveTrack(uint64 id) {
- DCHECK(tracks_.find(id) != tracks_.end());
+ if (tracks_.find(id) == tracks_.end())
+ return;
TrackInfo& info = tracks_[id];
ReportDuration(info);
« no previous file with comments | « no previous file | content/public/renderer/media_stream_audio_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698