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

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

Issue 32543006: Remove --enable-audible-notifications flag for feature launch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h"
10 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
11 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
12 #include "base/process/process.h" 11 #include "base/process/process.h"
13 #include "content/browser/browser_main_loop.h" 12 #include "content/browser/browser_main_loop.h"
14 #include "content/browser/media/media_internals.h" 13 #include "content/browser/media/media_internals.h"
15 #include "content/browser/renderer_host/media/audio_input_device_manager.h" 14 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
16 #include "content/browser/renderer_host/media/audio_mirroring_manager.h" 15 #include "content/browser/renderer_host/media/audio_mirroring_manager.h"
17 #include "content/browser/renderer_host/media/audio_sync_reader.h" 16 #include "content/browser/renderer_host/media/audio_sync_reader.h"
18 #include "content/browser/renderer_host/media/media_stream_manager.h" 17 #include "content/browser/renderer_host/media/media_stream_manager.h"
19 #include "content/common/media/audio_messages.h" 18 #include "content/common/media/audio_messages.h"
20 #include "content/public/browser/content_browser_client.h" 19 #include "content/public/browser/content_browser_client.h"
21 #include "content/public/browser/media_observer.h" 20 #include "content/public/browser/media_observer.h"
22 #include "content/public/common/content_switches.h"
23 #include "media/audio/audio_manager_base.h" 21 #include "media/audio/audio_manager_base.h"
24 #include "media/audio/shared_memory_util.h" 22 #include "media/audio/shared_memory_util.h"
25 #include "media/base/audio_bus.h" 23 #include "media/base/audio_bus.h"
26 #include "media/base/limits.h" 24 #include "media/base/limits.h"
27 25
28 using media::AudioBus; 26 using media::AudioBus;
29 27
30 namespace content { 28 namespace content {
31 29
32 class AudioRendererHost::AudioEntry 30 class AudioRendererHost::AudioEntry
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 240 }
243 241
244 void AudioRendererHost::DoNotifyAudioPowerLevel(int stream_id, 242 void AudioRendererHost::DoNotifyAudioPowerLevel(int stream_id,
245 float power_dbfs, 243 float power_dbfs,
246 bool clipped) { 244 bool clipped) {
247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
248 246
249 MediaObserver* const media_observer = 247 MediaObserver* const media_observer =
250 GetContentClient()->browser()->GetMediaObserver(); 248 GetContentClient()->browser()->GetMediaObserver();
251 if (media_observer) { 249 if (media_observer) {
252 if (CommandLine::ForCurrentProcess()->HasSwitch( 250 AudioEntry* const entry = LookupById(stream_id);
253 switches::kEnableAudibleNotifications)) { 251 if (entry) {
254 AudioEntry* const entry = LookupById(stream_id); 252 media_observer->OnAudioStreamPlayingChanged(
255 if (entry) { 253 render_process_id_, entry->render_view_id(), entry->stream_id(),
256 media_observer->OnAudioStreamPlayingChanged( 254 true, power_dbfs, clipped);
257 render_process_id_, entry->render_view_id(), entry->stream_id(),
258 true, power_dbfs, clipped);
259 }
260 } 255 }
261 } 256 }
262 } 257 }
263 258
264 /////////////////////////////////////////////////////////////////////////////// 259 ///////////////////////////////////////////////////////////////////////////////
265 // IPC Messages handler 260 // IPC Messages handler
266 bool AudioRendererHost::OnMessageReceived(const IPC::Message& message, 261 bool AudioRendererHost::OnMessageReceived(const IPC::Message& message,
267 bool* message_was_ok) { 262 bool* message_was_ok) {
268 bool handled = true; 263 bool handled = true;
269 IPC_BEGIN_MESSAGE_MAP_EX(AudioRendererHost, message, *message_was_ok) 264 IPC_BEGIN_MESSAGE_MAP_EX(AudioRendererHost, message, *message_was_ok)
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 470 }
476 471
477 AudioRendererHost::AudioEntry* AudioRendererHost::LookupById(int stream_id) { 472 AudioRendererHost::AudioEntry* AudioRendererHost::LookupById(int stream_id) {
478 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 473 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
479 474
480 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id); 475 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id);
481 return i != audio_entries_.end() ? i->second : NULL; 476 return i != audio_entries_.end() ? i->second : NULL;
482 } 477 }
483 478
484 } // namespace content 479 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698