Chromium Code Reviews| Index: content/browser/media/audio_debug_recording_impl.h |
| diff --git a/content/browser/media/audio_debug_recording_impl.h b/content/browser/media/audio_debug_recording_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..68aede78f668462fd3771352b0393b00fdfe9ada |
| --- /dev/null |
| +++ b/content/browser/media/audio_debug_recording_impl.h |
| @@ -0,0 +1,70 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_MEDIA_AUDIO_DEBUG_RECORDING_IMPL_H_ |
| +#define CONTENT_BROWSER_MEDIA_AUDIO_DEBUG_RECORDING_IMPL_H_ |
| + |
| +#include <set> |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/threading/thread_checker.h" |
| +#include "content/common/media/audio_debug_recording.mojom.h" |
| +#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace base { |
| +class FilePath; |
| +} |
| + |
| +namespace content { |
| + |
| +class AudioInputRendererHost; |
| + |
| +class AudioDebugRecordingImpl : public AudioDebugRecording { |
|
Henrik Grunell
2015/10/15 12:17:03
Comment with class description and threading story
Anand Mistry (off Chromium)
2015/10/21 03:58:24
Done.
|
| + public: |
| + using DisconnectCallback = base::Callback<void(AudioDebugRecordingImpl*)>; |
| + |
| + AudioDebugRecordingImpl( |
| + int render_host_id, |
| + const scoped_refptr<AudioInputRendererHost>& audio_input_renderer_host, |
| + const DisconnectCallback& disconnect_cb, |
| + mojo::InterfaceRequest<AudioDebugRecording> request); |
| + ~AudioDebugRecordingImpl() override; |
| + |
| + // Enables/disables AEC dumping. |
|
Henrik Grunell
2015/10/15 12:17:03
AEC dumping -> audio debug recordings.
Anand Mistry (off Chromium)
2015/10/21 03:58:23
Done.
|
| + void EnableAudioDebugRecording(const base::FilePath& file); |
| + void DisableAudioDebugRecording(); |
| + |
| + private: |
| + class DumpObserver; |
| + |
| + // |AudioDebugRecording| implementaion. |
| + void RegisterObserver(int32_t id, |
| + AudioDebugRecordingObserverPtr observer) override; |
| + |
| + // Mojo connection error callback. |
| + void OnConnectionError(); |
| + |
| + void RemoveObserver(DumpObserver* observer); |
| + |
| + // Render process host ID. |
| + const int render_host_id_; |
| + |
| + const scoped_refptr<AudioInputRendererHost> audio_input_renderer_host_; |
| + |
| + // Callback for Mojo disconnections. |
| + const DisconnectCallback disconnect_cb_; |
| + |
| + // Set of connected dump observers. |
| + std::set<DumpObserver*> observers_; |
| + |
| + base::ThreadChecker thread_checker_; |
| + mojo::Binding<AudioDebugRecording> binding_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AudioDebugRecordingImpl); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_MEDIA_AUDIO_DEBUG_RECORDING_IMPL_H_ |