| 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/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 user_input_monitor_(user_input_monitor), | 63 user_input_monitor_(user_input_monitor), |
| 64 audio_log_(MediaInternals::GetInstance()->CreateAudioLog( | 64 audio_log_(MediaInternals::GetInstance()->CreateAudioLog( |
| 65 media::AudioLogFactory::AUDIO_INPUT_CONTROLLER)) {} | 65 media::AudioLogFactory::AUDIO_INPUT_CONTROLLER)) {} |
| 66 | 66 |
| 67 AudioInputRendererHost::~AudioInputRendererHost() { | 67 AudioInputRendererHost::~AudioInputRendererHost() { |
| 68 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 68 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 69 DCHECK(audio_entries_.empty()); | 69 DCHECK(audio_entries_.empty()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void AudioInputRendererHost::OnChannelClosing() { | 72 void AudioInputRendererHost::OnChannelClosing() { |
| 73 // Since the IPC sender is gone, close all requested audio streams. | 73 // Since the IPC channel is gone, close all requested audio streams. |
| 74 DeleteEntries(); | 74 DeleteEntries(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void AudioInputRendererHost::OnDestruct() const { | 77 void AudioInputRendererHost::OnDestruct() const { |
| 78 BrowserThread::DeleteOnIOThread::Destruct(this); | 78 BrowserThread::DeleteOnIOThread::Destruct(this); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void AudioInputRendererHost::OnCreated( | 81 void AudioInputRendererHost::OnCreated( |
| 82 media::AudioInputController* controller) { | 82 media::AudioInputController* controller) { |
| 83 BrowserThread::PostTask( | 83 BrowserThread::PostTask( |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // TODO(hclam): Implement a faster look up method. | 464 // TODO(hclam): Implement a faster look up method. |
| 465 for (AudioEntryMap::iterator i = audio_entries_.begin(); | 465 for (AudioEntryMap::iterator i = audio_entries_.begin(); |
| 466 i != audio_entries_.end(); ++i) { | 466 i != audio_entries_.end(); ++i) { |
| 467 if (controller == i->second->controller.get()) | 467 if (controller == i->second->controller.get()) |
| 468 return i->second; | 468 return i->second; |
| 469 } | 469 } |
| 470 return NULL; | 470 return NULL; |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace content | 473 } // namespace content |
| OLD | NEW |