| OLD | NEW |
| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 AudioEntry* entry = it->second; | 293 AudioEntry* entry = it->second; |
| 294 if (entry->render_view_id() == render_view_id) | 294 if (entry->render_view_id() == render_view_id) |
| 295 controllers.push_back(entry->controller()); | 295 controllers.push_back(entry->controller()); |
| 296 } | 296 } |
| 297 | 297 |
| 298 return controllers; | 298 return controllers; |
| 299 } | 299 } |
| 300 | 300 |
| 301 /////////////////////////////////////////////////////////////////////////////// | 301 /////////////////////////////////////////////////////////////////////////////// |
| 302 // IPC Messages handler | 302 // IPC Messages handler |
| 303 bool AudioRendererHost::OnMessageReceived(const IPC::Message& message, | 303 bool AudioRendererHost::OnMessageReceived(const IPC::Message& message) { |
| 304 bool* message_was_ok) { | |
| 305 bool handled = true; | 304 bool handled = true; |
| 306 IPC_BEGIN_MESSAGE_MAP_EX(AudioRendererHost, message, *message_was_ok) | 305 IPC_BEGIN_MESSAGE_MAP(AudioRendererHost, message) |
| 307 IPC_MESSAGE_HANDLER(AudioHostMsg_CreateStream, OnCreateStream) | 306 IPC_MESSAGE_HANDLER(AudioHostMsg_CreateStream, OnCreateStream) |
| 308 IPC_MESSAGE_HANDLER(AudioHostMsg_PlayStream, OnPlayStream) | 307 IPC_MESSAGE_HANDLER(AudioHostMsg_PlayStream, OnPlayStream) |
| 309 IPC_MESSAGE_HANDLER(AudioHostMsg_PauseStream, OnPauseStream) | 308 IPC_MESSAGE_HANDLER(AudioHostMsg_PauseStream, OnPauseStream) |
| 310 IPC_MESSAGE_HANDLER(AudioHostMsg_CloseStream, OnCloseStream) | 309 IPC_MESSAGE_HANDLER(AudioHostMsg_CloseStream, OnCloseStream) |
| 311 IPC_MESSAGE_HANDLER(AudioHostMsg_SetVolume, OnSetVolume) | 310 IPC_MESSAGE_HANDLER(AudioHostMsg_SetVolume, OnSetVolume) |
| 312 IPC_MESSAGE_UNHANDLED(handled = false) | 311 IPC_MESSAGE_UNHANDLED(handled = false) |
| 313 IPC_END_MESSAGE_MAP_EX() | 312 IPC_END_MESSAGE_MAP() |
| 314 | 313 |
| 315 return handled; | 314 return handled; |
| 316 } | 315 } |
| 317 | 316 |
| 318 void AudioRendererHost::OnCreateStream( | 317 void AudioRendererHost::OnCreateStream( |
| 319 int stream_id, int render_view_id, int render_frame_id, int session_id, | 318 int stream_id, int render_view_id, int render_frame_id, int session_id, |
| 320 const media::AudioParameters& params) { | 319 const media::AudioParameters& params) { |
| 321 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 320 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 322 | 321 |
| 323 DVLOG(1) << "AudioRendererHost@" << this | 322 DVLOG(1) << "AudioRendererHost@" << this |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 477 } |
| 479 | 478 |
| 480 AudioRendererHost::AudioEntry* AudioRendererHost::LookupById(int stream_id) { | 479 AudioRendererHost::AudioEntry* AudioRendererHost::LookupById(int stream_id) { |
| 481 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 480 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 482 | 481 |
| 483 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id); | 482 AudioEntryMap::const_iterator i = audio_entries_.find(stream_id); |
| 484 return i != audio_entries_.end() ? i->second : NULL; | 483 return i != audio_entries_.end() ? i->second : NULL; |
| 485 } | 484 } |
| 486 | 485 |
| 487 } // namespace content | 486 } // namespace content |
| OLD | NEW |