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/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 #include "content/browser/browser_main_loop.h" | 11 #include "content/browser/browser_main_loop.h" |
12 #include "content/browser/renderer_host/media/audio_sync_reader.h" | 12 #include "content/browser/renderer_host/media/audio_sync_reader.h" |
13 #include "content/common/media/audio_messages.h" | 13 #include "content/common/media/audio_messages.h" |
14 #include "content/public/browser/media_observer.h" | 14 #include "content/public/browser/media_observer.h" |
15 #include "media/audio/audio_util.h" | 15 #include "media/audio/shared_memory_util.h" |
16 | 16 |
17 using content::BrowserMessageFilter; | 17 using content::BrowserMessageFilter; |
18 using content::BrowserThread; | 18 using content::BrowserThread; |
19 | 19 |
20 AudioRendererHost::AudioEntry::AudioEntry() | 20 AudioRendererHost::AudioEntry::AudioEntry() |
21 : stream_id(0), | 21 : stream_id(0), |
22 pending_close(false) { | 22 pending_close(false) { |
23 } | 23 } |
24 | 24 |
25 AudioRendererHost::AudioEntry::~AudioEntry() {} | 25 AudioRendererHost::AudioEntry::~AudioEntry() {} |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 376 |
377 // Iterate the map of entries. | 377 // Iterate the map of entries. |
378 // TODO(hclam): Implement a faster look up method. | 378 // TODO(hclam): Implement a faster look up method. |
379 for (AudioEntryMap::iterator i = audio_entries_.begin(); | 379 for (AudioEntryMap::iterator i = audio_entries_.begin(); |
380 i != audio_entries_.end(); ++i) { | 380 i != audio_entries_.end(); ++i) { |
381 if (!i->second->pending_close && controller == i->second->controller.get()) | 381 if (!i->second->pending_close && controller == i->second->controller.get()) |
382 return i->second; | 382 return i->second; |
383 } | 383 } |
384 return NULL; | 384 return NULL; |
385 } | 385 } |
OLD | NEW |