Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: content/browser/renderer_host/media/audio_input_renderer_host.h

Issue 1272223003: Implement writing mic audio input data to file for debugging purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/audio_input_renderer_host.h
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.h b/content/browser/renderer_host/media/audio_input_renderer_host.h
index eca0a6499be6500d51175484825cb041dcc6cda8..80dfc838d27409e2eee9f9644f2f71ac7f07a952 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.h
@@ -32,6 +32,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/shared_memory.h"
+#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "base/sequenced_task_runner_helpers.h"
#include "content/common/media/audio_messages.h"
@@ -51,6 +52,7 @@ class UserInputMonitor;
namespace content {
class AudioMirroringManager;
class MediaStreamManager;
+class RenderProcessHost;
class CONTENT_EXPORT AudioInputRendererHost
: public BrowserMessageFilter,
@@ -107,6 +109,10 @@ class CONTENT_EXPORT AudioInputRendererHost
AudioMirroringManager* audio_mirroring_manager,
media::UserInputMonitor* user_input_monitor);
+ // Enable and disable debug recording of input on all audio entries.
+ void EnableDebugRecording(const base::FilePath& file);
+ void DisableDebugRecording();
+
// BrowserMessageFilter implementation.
void OnChannelClosing() override;
void OnDestruct() const override;
@@ -210,6 +216,19 @@ class CONTENT_EXPORT AudioInputRendererHost
void MaybeUnregisterKeyboardMicStream(
const AudioInputHostMsg_CreateStream_Config& config);
+ void MaybeEnableDebugRecordingForId(int stream_id);
+
+ base::FilePath GetDebugRecordingFilePathWithExtensions(
+ const base::FilePath& file);
+
+ void EnabledDebugRecordingForId(const base::FilePath& file, int stream_id);
+
+ void DoEnableDebugRecording(int stream_id, base::File file);
+ void DoDisableDebugRecording(int stream_id);
+
+ // Delete the debug writer used for debug recordings for |stream_id|.
+ void DeleteDebugWriter(int stream_id);
+
// ID of the RenderProcessHost that owns this instance.
const int render_process_id_;
@@ -229,6 +248,8 @@ class CONTENT_EXPORT AudioInputRendererHost
scoped_ptr<media::AudioLog> audio_log_;
+ base::WeakPtrFactory<AudioInputRendererHost> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost);
};

Powered by Google App Engine
This is Rietveld 408576698