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_input_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 : audio_manager_(audio_manager), | 56 : audio_manager_(audio_manager), |
57 media_stream_manager_(media_stream_manager), | 57 media_stream_manager_(media_stream_manager), |
58 audio_mirroring_manager_(audio_mirroring_manager), | 58 audio_mirroring_manager_(audio_mirroring_manager), |
59 user_input_monitor_(user_input_monitor) {} | 59 user_input_monitor_(user_input_monitor) {} |
60 | 60 |
61 AudioInputRendererHost::~AudioInputRendererHost() { | 61 AudioInputRendererHost::~AudioInputRendererHost() { |
62 DCHECK(audio_entries_.empty()); | 62 DCHECK(audio_entries_.empty()); |
63 } | 63 } |
64 | 64 |
65 void AudioInputRendererHost::OnChannelClosing() { | 65 void AudioInputRendererHost::OnChannelClosing() { |
66 BrowserMessageFilter::OnChannelClosing(); | |
67 | |
68 // Since the IPC channel is gone, close all requested audio streams. | 66 // Since the IPC channel is gone, close all requested audio streams. |
69 DeleteEntries(); | 67 DeleteEntries(); |
70 } | 68 } |
71 | 69 |
72 void AudioInputRendererHost::OnDestruct() const { | 70 void AudioInputRendererHost::OnDestruct() const { |
73 BrowserThread::DeleteOnIOThread::Destruct(this); | 71 BrowserThread::DeleteOnIOThread::Destruct(this); |
74 } | 72 } |
75 | 73 |
76 void AudioInputRendererHost::OnCreated( | 74 void AudioInputRendererHost::OnCreated( |
77 media::AudioInputController* controller) { | 75 media::AudioInputController* controller) { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // TODO(hclam): Implement a faster look up method. | 400 // TODO(hclam): Implement a faster look up method. |
403 for (AudioEntryMap::iterator i = audio_entries_.begin(); | 401 for (AudioEntryMap::iterator i = audio_entries_.begin(); |
404 i != audio_entries_.end(); ++i) { | 402 i != audio_entries_.end(); ++i) { |
405 if (controller == i->second->controller.get()) | 403 if (controller == i->second->controller.get()) |
406 return i->second; | 404 return i->second; |
407 } | 405 } |
408 return NULL; | 406 return NULL; |
409 } | 407 } |
410 | 408 |
411 } // namespace content | 409 } // namespace content |
OLD | NEW |