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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host.cc

Issue 324143002: Decouple IPC::MessageFilter from IPC::Channel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/audio_renderer_host.h" 5 #include "content/browser/renderer_host/media/audio_renderer_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 const RenderViewHost::GetAudioOutputControllersCallback& callback) const { 148 const RenderViewHost::GetAudioOutputControllersCallback& callback) const {
149 BrowserThread::PostTaskAndReplyWithResult( 149 BrowserThread::PostTaskAndReplyWithResult(
150 BrowserThread::IO, 150 BrowserThread::IO,
151 FROM_HERE, 151 FROM_HERE,
152 base::Bind(&AudioRendererHost::DoGetOutputControllers, this, 152 base::Bind(&AudioRendererHost::DoGetOutputControllers, this,
153 render_view_id), 153 render_view_id),
154 callback); 154 callback);
155 } 155 }
156 156
157 void AudioRendererHost::OnChannelClosing() { 157 void AudioRendererHost::OnChannelClosing() {
158 // Since the IPC channel is gone, close all requested audio streams. 158 // Since the IPC sender is gone, close all requested audio streams.
159 while (!audio_entries_.empty()) { 159 while (!audio_entries_.empty()) {
160 // Note: OnCloseStream() removes the entries from audio_entries_. 160 // Note: OnCloseStream() removes the entries from audio_entries_.
161 OnCloseStream(audio_entries_.begin()->first); 161 OnCloseStream(audio_entries_.begin()->first);
162 } 162 }
163 } 163 }
164 164
165 void AudioRendererHost::OnDestruct() const { 165 void AudioRendererHost::OnDestruct() const {
166 BrowserThread::DeleteOnIOThread::Destruct(this); 166 BrowserThread::DeleteOnIOThread::Destruct(this);
167 } 167 }
168 168
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id); 499 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id);
500 return i != audio_entries_.end() ? i->second : NULL; 500 return i != audio_entries_.end() ? i->second : NULL;
501 } 501 }
502 502
503 bool AudioRendererHost::HasActiveAudio() { 503 bool AudioRendererHost::HasActiveAudio() {
504 return !base::AtomicRefCountIsZero(&num_playing_streams_); 504 return !base::AtomicRefCountIsZero(&num_playing_streams_);
505 } 505 }
506 506
507 } // namespace content 507 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698