Commit 0d154c3f authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Merge AecDumpAgentImplDelegate back into AecDumpAgentImpl

... and remove it out of the Blink exposed API.

This change is a follow up of [1], where AecDumpAgentImpl::Delegate
was factored out into AecDumpAgentImplDelegate, and made temporarily
public.

[1] https://crrev.com/c/1710237

BUG=704136,919392
R=guidou@chromium.org

Change-Id: I130a45549b5866fd9235099ef4e1a4963f9eedf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739289
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684375}
parent 012a1835
...@@ -141,7 +141,6 @@ source_set("blink_headers") { ...@@ -141,7 +141,6 @@ source_set("blink_headers") {
"platform/modules/media_capabilities/web_media_configuration.h", "platform/modules/media_capabilities/web_media_configuration.h",
"platform/modules/media_capabilities/web_media_decoding_configuration.h", "platform/modules/media_capabilities/web_media_decoding_configuration.h",
"platform/modules/media_capabilities/web_video_configuration.h", "platform/modules/media_capabilities/web_video_configuration.h",
"platform/modules/mediastream/aec_dump_agent_impl_delegate.h",
"platform/modules/mediastream/media_stream_audio_deliverer.h", "platform/modules/mediastream/media_stream_audio_deliverer.h",
"platform/modules/mediastream/media_stream_audio_level_calculator.h", "platform/modules/mediastream/media_stream_audio_level_calculator.h",
"platform/modules/mediastream/media_stream_audio_processor_options.h", "platform/modules/mediastream/media_stream_audio_processor_options.h",
......
// Copyright 2019 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 THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_MEDIASTREAM_AEC_DUMP_AGENT_IMPL_DELEGATE_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_MEDIASTREAM_AEC_DUMP_AGENT_IMPL_DELEGATE_H_
#include "third_party/blink/public/platform/web_common.h"
namespace blink {
// TODO(crbug.com/704136): Move this class out of the Blink exposed API
// back into AecDumpAgentImpl when all its users have been Onion Souped.
class BLINK_PLATFORM_EXPORT AecDumpAgentImplDelegate {
public:
virtual void OnStartDump(base::File file) = 0;
virtual void OnStopDump() = 0;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_MEDIASTREAM_AEC_DUMP_AGENT_IMPL_DELEGATE_H_
...@@ -6,14 +6,12 @@ ...@@ -6,14 +6,12 @@
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#include "third_party/blink/public/platform/modules/mediastream/aec_dump_agent_impl_delegate.h"
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
namespace blink { namespace blink {
// static // static
std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create( std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create(Delegate* delegate) {
AecDumpAgentImplDelegate* delegate) {
// TODO(crbug.com/704136): Use GetInterfaceProvider() here. // TODO(crbug.com/704136): Use GetInterfaceProvider() here.
if (!Platform::Current()->GetConnector()) // Can be true in unit tests. if (!Platform::Current()->GetConnector()) // Can be true in unit tests.
return nullptr; return nullptr;
...@@ -32,7 +30,7 @@ std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create( ...@@ -32,7 +30,7 @@ std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create(
} }
AecDumpAgentImpl::AecDumpAgentImpl( AecDumpAgentImpl::AecDumpAgentImpl(
AecDumpAgentImplDelegate* delegate, Delegate* delegate,
mojo::PendingReceiver<mojom::blink::AecDumpAgent> receiver) mojo::PendingReceiver<mojom::blink::AecDumpAgent> receiver)
: delegate_(delegate), receiver_(this, std::move(receiver)) {} : delegate_(delegate), receiver_(this, std::move(receiver)) {}
......
...@@ -12,15 +12,18 @@ ...@@ -12,15 +12,18 @@
namespace blink { namespace blink {
class AecDumpAgentImplDelegate;
// An instance of this class connects to the browser process to register for // An instance of this class connects to the browser process to register for
// notifications to start / stop writing to a dump file. // notifications to start / stop writing to a dump file.
class AecDumpAgentImpl : public mojom::blink::AecDumpAgent { class AecDumpAgentImpl : public mojom::blink::AecDumpAgent {
public: public:
class Delegate {
public:
virtual void OnStartDump(base::File file) = 0;
virtual void OnStopDump() = 0;
};
// This may fail in unit tests, in which case a null object is returned. // This may fail in unit tests, in which case a null object is returned.
static std::unique_ptr<AecDumpAgentImpl> Create( static std::unique_ptr<AecDumpAgentImpl> Create(Delegate* delegate);
AecDumpAgentImplDelegate* delegate);
~AecDumpAgentImpl() override; ~AecDumpAgentImpl() override;
...@@ -30,10 +33,10 @@ class AecDumpAgentImpl : public mojom::blink::AecDumpAgent { ...@@ -30,10 +33,10 @@ class AecDumpAgentImpl : public mojom::blink::AecDumpAgent {
private: private:
explicit AecDumpAgentImpl( explicit AecDumpAgentImpl(
AecDumpAgentImplDelegate* delegate, Delegate* delegate,
mojo::PendingReceiver<mojom::blink::AecDumpAgent> receiver); mojo::PendingReceiver<mojom::blink::AecDumpAgent> receiver);
AecDumpAgentImplDelegate* delegate_; Delegate* delegate_;
mojo::Receiver<mojom::blink::AecDumpAgent> receiver_{this}; mojo::Receiver<mojom::blink::AecDumpAgent> receiver_{this};
DISALLOW_COPY_AND_ASSIGN(AecDumpAgentImpl); DISALLOW_COPY_AND_ASSIGN(AecDumpAgentImpl);
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "media/base/audio_processing.h" #include "media/base/audio_processing.h"
#include "media/webrtc/audio_processor_controls.h" #include "media/webrtc/audio_processor_controls.h"
#include "third_party/blink/public/platform/modules/mediastream/aec_dump_agent_impl_delegate.h"
#include "third_party/blink/public/platform/web_common.h" #include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/renderer/platform/mediastream/aec_dump_agent_impl.h"
#include "third_party/webrtc/api/media_stream_interface.h" #include "third_party/webrtc/api/media_stream_interface.h"
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h" #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
#include "third_party/webrtc/rtc_base/task_queue.h" #include "third_party/webrtc/rtc_base/task_queue.h"
...@@ -34,7 +34,7 @@ class AecDumpAgentImpl; ...@@ -34,7 +34,7 @@ class AecDumpAgentImpl;
// calculation code should be encapsulated in a class. // calculation code should be encapsulated in a class.
class BLINK_PLATFORM_EXPORT AudioServiceAudioProcessorProxy class BLINK_PLATFORM_EXPORT AudioServiceAudioProcessorProxy
: public webrtc::AudioProcessorInterface, : public webrtc::AudioProcessorInterface,
public AecDumpAgentImplDelegate { public AecDumpAgentImpl::Delegate {
public: public:
// All methods (including constructor and destructor) must be called on the // All methods (including constructor and destructor) must be called on the
// main thread except for GetStats. // main thread except for GetStats.
...@@ -48,7 +48,7 @@ class BLINK_PLATFORM_EXPORT AudioServiceAudioProcessorProxy ...@@ -48,7 +48,7 @@ class BLINK_PLATFORM_EXPORT AudioServiceAudioProcessorProxy
// This method is called on the libjingle thread. // This method is called on the libjingle thread.
AudioProcessorStatistics GetStats(bool has_remote_tracks) override; AudioProcessorStatistics GetStats(bool has_remote_tracks) override;
// AecDumpAgentImplDelegate implementation. // AecDumpAgentImpl::Delegate implementation.
// Called on the main render thread. // Called on the main render thread.
void OnStartDump(base::File file) override; void OnStartDump(base::File file) override;
void OnStopDump() override; void OnStopDump() override;
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
#include "media/base/audio_converter.h" #include "media/base/audio_converter.h"
#include "media/webrtc/audio_delay_stats_reporter.h" #include "media/webrtc/audio_delay_stats_reporter.h"
#include "third_party/blink/public/common/mediastream/media_stream_request.h" #include "third_party/blink/public/common/mediastream/media_stream_request.h"
#include "third_party/blink/public/platform/modules/mediastream/aec_dump_agent_impl_delegate.h"
#include "third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h" #include "third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h"
#include "third_party/blink/public/platform/modules/webrtc/webrtc_source.h" #include "third_party/blink/public/platform/modules/webrtc/webrtc_source.h"
#include "third_party/blink/renderer/platform/mediastream/aec_dump_agent_impl.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/webrtc/api/media_stream_interface.h" #include "third_party/webrtc/api/media_stream_interface.h"
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h" #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
...@@ -51,7 +51,7 @@ using webrtc::AudioProcessorInterface; ...@@ -51,7 +51,7 @@ using webrtc::AudioProcessorInterface;
class PLATFORM_EXPORT MediaStreamAudioProcessor class PLATFORM_EXPORT MediaStreamAudioProcessor
: public WebRtcPlayoutDataSource::Sink, : public WebRtcPlayoutDataSource::Sink,
public AudioProcessorInterface, public AudioProcessorInterface,
public AecDumpAgentImplDelegate { public AecDumpAgentImpl::Delegate {
public: public:
// |playout_data_source| is used to register this class as a sink to the // |playout_data_source| is used to register this class as a sink to the
// WebRtc playout data for processing AEC. If clients do not enable AEC, // WebRtc playout data for processing AEC. If clients do not enable AEC,
...@@ -104,7 +104,7 @@ class PLATFORM_EXPORT MediaStreamAudioProcessor ...@@ -104,7 +104,7 @@ class PLATFORM_EXPORT MediaStreamAudioProcessor
// Accessor to check if the audio processing is enabled or not. // Accessor to check if the audio processing is enabled or not.
bool has_audio_processing() const { return !!audio_processing_; } bool has_audio_processing() const { return !!audio_processing_; }
// AecDumpAgentImplDelegate implementation. // AecDumpAgentImpl::Delegate implementation.
// Called on the main render thread. // Called on the main render thread.
void OnStartDump(base::File dump_file) override; void OnStartDump(base::File dump_file) override;
void OnStopDump() override; void OnStopDump() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment