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

Unified Diff: content/renderer/media/aec_dump_message_filter.h

Issue 1246283003: Split out audio debug recording from RenderProcessHostImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 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/renderer/media/aec_dump_message_filter.h
diff --git a/content/renderer/media/aec_dump_message_filter.h b/content/renderer/media/aec_dump_message_filter.h
deleted file mode 100644
index 1254173b0c5cda0efcef5aa48d46514eba3b4432..0000000000000000000000000000000000000000
--- a/content/renderer/media/aec_dump_message_filter.h
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2014 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_RENDERER_MEDIA_AEC_DUMP_MESSAGE_FILTER_H_
-#define CONTENT_RENDERER_MEDIA_AEC_DUMP_MESSAGE_FILTER_H_
-
-#include "base/memory/scoped_ptr.h"
-#include "content/common/content_export.h"
-#include "content/renderer/render_thread_impl.h"
-#include "ipc/ipc_platform_file.h"
-#include "ipc/message_filter.h"
-
-namespace base {
-class SingleThreadTaskRunner;
-}
-
-namespace content {
-
-// MessageFilter that handles AEC dump messages and forwards them to an
-// observer.
-class CONTENT_EXPORT AecDumpMessageFilter : public IPC::MessageFilter {
- public:
- class AecDumpDelegate {
- public:
- virtual void OnAecDumpFile(
- const IPC::PlatformFileForTransit& file_handle) = 0;
- virtual void OnDisableAecDump() = 0;
- virtual void OnIpcClosing() = 0;
- };
-
- AecDumpMessageFilter(
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
-
- // Getter for the one AecDumpMessageFilter object.
- static scoped_refptr<AecDumpMessageFilter> Get();
-
- // Adds a delegate that receives the enable and disable notifications.
- void AddDelegate(AecDumpMessageFilter::AecDumpDelegate* delegate);
-
- // Removes a delegate.
- void RemoveDelegate(AecDumpMessageFilter::AecDumpDelegate* delegate);
-
- // IO task runner associated with this message filter.
- scoped_refptr<base::SingleThreadTaskRunner> io_task_runner() const {
- return io_task_runner_;
- }
-
- protected:
- ~AecDumpMessageFilter() override;
-
- private:
- // Sends an IPC message using |sender_|.
- void Send(IPC::Message* message);
-
- // Registers a consumer of AEC dump in the browser process. This consumer will
- // get a file handle when the AEC dump is enabled and a notification when it
- // is disabled.
- void RegisterAecDumpConsumer(int id);
-
- // Unregisters a consumer of AEC dump in the browser process.
- void UnregisterAecDumpConsumer(int id);
-
- // IPC::MessageFilter override. Called on |io_task_runner|.
- bool OnMessageReceived(const IPC::Message& message) override;
- void OnFilterAdded(IPC::Sender* sender) override;
- void OnFilterRemoved() override;
- void OnChannelClosing() override;
-
- // Accessed on |io_task_runner_|.
- void OnEnableAecDump(int id, IPC::PlatformFileForTransit file_handle);
- void OnDisableAecDump();
-
- // Accessed on |main_task_runner_|.
- void DoEnableAecDump(int id, IPC::PlatformFileForTransit file_handle);
- void DoDisableAecDump();
- void DoChannelClosingOnDelegates();
- int GetIdForDelegate(AecDumpMessageFilter::AecDumpDelegate* delegate);
-
- // Accessed on |io_task_runner_|.
- IPC::Sender* sender_;
-
- // The delgates for this filter. Must only be accessed on
- // |main_task_runner_|.
- typedef std::map<int, AecDumpMessageFilter::AecDumpDelegate*> DelegateMap;
- DelegateMap delegates_;
-
- // Counter for generating unique IDs to delegates. Accessed on
- // |main_task_runner_|.
- int delegate_id_counter_;
-
- // Task runner which IPC calls are executed.
- const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
-
- // Main task runner.
- const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
-
- // The singleton instance for this filter.
- static AecDumpMessageFilter* g_filter;
-
- DISALLOW_COPY_AND_ASSIGN(AecDumpMessageFilter);
-};
-
-} // namespace content
-
-#endif // CONTENT_RENDERER_MEDIA_AEC_DUMP_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698