From d1f173980bbf7dffb92b5857866dd75156ad2157 Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Fri, 3 Apr 2009 23:05:30 +0000 Subject: Remove a DCHECK in RenderView::CloseAudioStream Allow an audio stream to be closed multiple times, use an if statement instead of DCHECK. TBR=cpu Review URL: http://codereview.chromium.org/60107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13122 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/render_view.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'chrome') diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index a13c74f..91d93119 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2950,11 +2950,13 @@ void RenderView::StartAudioStream(int stream_id) { void RenderView::CloseAudioStream(int stream_id) { DCHECK(RenderThread::current()->message_loop() == MessageLoop::current()); - DCHECK(audio_renderers_.Lookup(stream_id) != NULL); - // Remove the entry from the map and send a close message to browser process, - // we won't be getting anything back from browser even if there's an error. - audio_renderers_.Remove(stream_id); - Send(new ViewHostMsg_CloseAudioStream(routing_id_, stream_id)); + if (audio_renderers_.Lookup(stream_id) != NULL) { + // Remove the entry from the map and send a close message to browser + // process, we won't be getting anything back from browser even if there's + // an error. + audio_renderers_.Remove(stream_id); + Send(new ViewHostMsg_CloseAudioStream(routing_id_, stream_id)); + } } void RenderView::NotifyAudioPacketReady(int stream_id, size_t size) { -- cgit v1.1