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

Unified Diff: content/browser/media/audio_debug_controller.h

Issue 1246283003: Split out audio debug recording from RenderProcessHostImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile. Created 4 years, 11 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
« no previous file with comments | « no previous file | content/browser/media/audio_debug_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/audio_debug_controller.h
diff --git a/content/browser/media/audio_debug_controller.h b/content/browser/media/audio_debug_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..06e9be94c75a7dbfba2ad4215131a42ea6ecce30
--- /dev/null
+++ b/content/browser/media/audio_debug_controller.h
@@ -0,0 +1,74 @@
+// 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_CONTROLLER_H_
+#define CONTENT_BROWSER_MEDIA_AUDIO_DEBUG_CONTROLLER_H_
+
+#include <set>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/threading/thread_checker.h"
+#include "content/common/media/audio_debug_recording.mojom.h"
+
+namespace base {
+
+template <typename T>
+struct DefaultSingletonTraits;
+
+class FilePath;
+
+} // namespace base
+
+namespace content {
+
+class AudioDebugRecordingImpl;
+class AudioInputRendererHost;
+
+// Singleton factory used to create and manage new AudioDebugRecording service
+// instances for renderers.
+//
+// All functions must be called on the same thread.
+class AudioDebugController {
+ public:
+ static AudioDebugController* GetInstance();
+
+ // Factory method to create a new AudioDebugRecording service instance.
+ static void CreateService(
+ int render_host_id,
+ const scoped_refptr<AudioInputRendererHost>& audio_input_renderer_host,
+ mojo::InterfaceRequest<AudioDebugRecording> request);
+
+ // Enable/disable audio debug recordings for all renderers.
+ void EnableAudioDebugRecording(const base::FilePath& file);
+ void DisableAudioDebugRecording();
+
+ // Enable/disable audio debug recordings for a specific renderer.
+ void EnableAudioDebugRecordingForHost(int render_host_id,
+ const base::FilePath& file);
+ void DisableAudioDebugRecordingForHost(int render_host_id);
+
+ private:
+ AudioDebugController();
+ ~AudioDebugController();
+ friend struct base::DefaultSingletonTraits<AudioDebugController>;
+
+ void CreateServiceInternal(
+ int render_host_id,
+ const scoped_refptr<AudioInputRendererHost>& audio_input_renderer_host,
+ mojo::InterfaceRequest<AudioDebugRecording> request);
+
+ // Service disconnection callback.
+ void OnDisconnect(AudioDebugRecordingImpl* impl);
+
+ // Owns AudioDebugRecordingImpl.
+ std::set<AudioDebugRecordingImpl*> registered_impls_;
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioDebugController);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_AUDIO_DEBUG_CONTROLLER_H_
« no previous file with comments | « no previous file | content/browser/media/audio_debug_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698