Commit afe481a2 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Move aec_dump.mojom to blink

... from content/common/media.

This is part of phase 4.5 on the design doc [1].

[1] https://docs.google.com/document/d/1rHJGi1U72qZsOGIctIf7GKRaY8d7BgtVW8MaMYumzYY/

TBR=clamy@chromium.org (for content/browser mechanical changes)

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

Change-Id: I4211d558b0c1f608537518b7a6a7b833e0e32a83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1706549Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarDarin Fisher <darin@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#678534}
parent 16c04059
...@@ -27,7 +27,7 @@ AecDumpManagerImpl::AecDumpManagerImpl() = default; ...@@ -27,7 +27,7 @@ AecDumpManagerImpl::AecDumpManagerImpl() = default;
AecDumpManagerImpl::~AecDumpManagerImpl() = default; AecDumpManagerImpl::~AecDumpManagerImpl() = default;
void AecDumpManagerImpl::AddRequest( void AecDumpManagerImpl::AddRequest(
mojo::InterfaceRequest<mojom::AecDumpManager> request) { mojo::InterfaceRequest<blink::mojom::AecDumpManager> request) {
receiver_set_.Add(this, std::move(request)); receiver_set_.Add(this, std::move(request));
} }
...@@ -47,7 +47,8 @@ void AecDumpManagerImpl::Stop() { ...@@ -47,7 +47,8 @@ void AecDumpManagerImpl::Stop() {
it.second->Stop(); it.second->Stop();
} }
void AecDumpManagerImpl::Add(mojo::PendingRemote<mojom::AecDumpAgent> agent) { void AecDumpManagerImpl::Add(
mojo::PendingRemote<blink::mojom::AecDumpAgent> agent) {
int id = ++id_counter_; int id = ++id_counter_;
agents_.emplace(std::make_pair(id, std::move(agent))); agents_.emplace(std::make_pair(id, std::move(agent)));
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include <memory> #include <memory>
#include "base/process/process_handle.h" #include "base/process/process_handle.h"
#include "content/common/media/aec_dump.mojom.h"
#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/receiver_set.h"
#include "third_party/blink/public/mojom/mediastream/aec_dump.mojom.h"
namespace base { namespace base {
class File; class File;
...@@ -19,12 +19,12 @@ class FilePath; ...@@ -19,12 +19,12 @@ class FilePath;
namespace content { namespace content {
class AecDumpManagerImpl : public mojom::AecDumpManager { class AecDumpManagerImpl : public blink::mojom::AecDumpManager {
public: public:
AecDumpManagerImpl(); AecDumpManagerImpl();
~AecDumpManagerImpl() override; ~AecDumpManagerImpl() override;
void AddRequest(mojo::InterfaceRequest<mojom::AecDumpManager> request); void AddRequest(mojo::InterfaceRequest<blink::mojom::AecDumpManager> request);
// Start generating AEC dumps using default settings. // Start generating AEC dumps using default settings.
void AutoStart(); void AutoStart();
...@@ -36,7 +36,7 @@ class AecDumpManagerImpl : public mojom::AecDumpManager { ...@@ -36,7 +36,7 @@ class AecDumpManagerImpl : public mojom::AecDumpManager {
void Stop(); void Stop();
// mojom::AecDumpManager methods: // mojom::AecDumpManager methods:
void Add(mojo::PendingRemote<mojom::AecDumpAgent> agent) override; void Add(mojo::PendingRemote<blink::mojom::AecDumpAgent> agent) override;
void set_pid(base::ProcessId pid) { pid_ = pid; } void set_pid(base::ProcessId pid) { pid_ = pid; }
...@@ -46,9 +46,9 @@ class AecDumpManagerImpl : public mojom::AecDumpManager { ...@@ -46,9 +46,9 @@ class AecDumpManagerImpl : public mojom::AecDumpManager {
void OnAgentDisconnected(int id); void OnAgentDisconnected(int id);
base::ProcessId pid_ = 0; base::ProcessId pid_ = 0;
std::map<int /* id */, mojo::Remote<mojom::AecDumpAgent>> agents_; std::map<int /* id */, mojo::Remote<blink::mojom::AecDumpAgent>> agents_;
int id_counter_ = 0; int id_counter_ = 0;
mojo::ReceiverSet<mojom::AecDumpManager> receiver_set_; mojo::ReceiverSet<blink::mojom::AecDumpManager> receiver_set_;
base::WeakPtrFactory<AecDumpManagerImpl> weak_factory_{this}; base::WeakPtrFactory<AecDumpManagerImpl> weak_factory_{this};
......
...@@ -481,7 +481,6 @@ mojom("mojo_bindings") { ...@@ -481,7 +481,6 @@ mojom("mojo_bindings") {
"input/input_handler.mojom", "input/input_handler.mojom",
"input/input_injector.mojom", "input/input_injector.mojom",
"input/synchronous_compositor.mojom", "input/synchronous_compositor.mojom",
"media/aec_dump.mojom",
"media/peer_connection_tracker.mojom", "media/peer_connection_tracker.mojom",
"media/renderer_audio_input_stream_factory.mojom", "media/renderer_audio_input_stream_factory.mojom",
"media/renderer_audio_output_stream_factory.mojom", "media/renderer_audio_output_stream_factory.mojom",
......
...@@ -53,6 +53,7 @@ const service_manager::Manifest& GetContentBrowserManifest() { ...@@ -53,6 +53,7 @@ const service_manager::Manifest& GetContentBrowserManifest() {
.ExposeCapability( .ExposeCapability(
"renderer", "renderer",
std::set<const char*>{ std::set<const char*>{
"blink.mojom.AecDumpManager",
"blink.mojom.AppCacheBackend", "blink.mojom.AppCacheBackend",
"blink.mojom.BlobRegistry", "blink.mojom.BlobRegistry",
"blink.mojom.BroadcastChannelProvider", "blink.mojom.BroadcastChannelProvider",
...@@ -72,7 +73,6 @@ const service_manager::Manifest& GetContentBrowserManifest() { ...@@ -72,7 +73,6 @@ const service_manager::Manifest& GetContentBrowserManifest() {
"blink.mojom.ReportingServiceProxy", "blink.mojom.ReportingServiceProxy",
"blink.mojom.StoragePartitionService", "blink.mojom.StoragePartitionService",
"blink.mojom.WebDatabaseHost", "blink.mojom.WebDatabaseHost",
"content.mojom.AecDumpManager",
"content.mojom.ClipboardHost", "content.mojom.ClipboardHost",
"content.mojom.FieldTrialRecorder", "content.mojom.FieldTrialRecorder",
"content.mojom.FrameSinkProvider", "content.mojom.FrameSinkProvider",
......
...@@ -16,7 +16,7 @@ std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create(Delegate* delegate) { ...@@ -16,7 +16,7 @@ std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create(Delegate* delegate) {
if (!ChildThread::Get()) // Can be true in unit tests. if (!ChildThread::Get()) // Can be true in unit tests.
return nullptr; return nullptr;
mojo::Remote<mojom::AecDumpManager> manager; mojo::Remote<blink::mojom::AecDumpManager> manager;
ChildThread::Get()->GetConnector()->Connect( ChildThread::Get()->GetConnector()->Connect(
mojom::kBrowserServiceName, manager.BindNewPipeAndPassReceiver()); mojom::kBrowserServiceName, manager.BindNewPipeAndPassReceiver());
...@@ -30,7 +30,7 @@ std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create(Delegate* delegate) { ...@@ -30,7 +30,7 @@ std::unique_ptr<AecDumpAgentImpl> AecDumpAgentImpl::Create(Delegate* delegate) {
AecDumpAgentImpl::AecDumpAgentImpl( AecDumpAgentImpl::AecDumpAgentImpl(
Delegate* delegate, Delegate* delegate,
mojo::PendingReceiver<mojom::AecDumpAgent> receiver) mojo::PendingReceiver<blink::mojom::AecDumpAgent> receiver)
: delegate_(delegate), receiver_(this, std::move(receiver)) {} : delegate_(delegate), receiver_(this, std::move(receiver)) {}
AecDumpAgentImpl::~AecDumpAgentImpl() = default; AecDumpAgentImpl::~AecDumpAgentImpl() = default;
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
#define CONTENT_RENDERER_MEDIA_STREAM_AEC_DUMP_AGENT_IMPL_H_ #define CONTENT_RENDERER_MEDIA_STREAM_AEC_DUMP_AGENT_IMPL_H_
#include "base/macros.h" #include "base/macros.h"
#include "content/common/media/aec_dump.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
#include "third_party/blink/public/mojom/mediastream/aec_dump.mojom.h"
namespace content { namespace content {
// 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::AecDumpAgent { class AecDumpAgentImpl : public blink::mojom::AecDumpAgent {
public: public:
class Delegate { class Delegate {
public: public:
...@@ -33,10 +33,10 @@ class AecDumpAgentImpl : public mojom::AecDumpAgent { ...@@ -33,10 +33,10 @@ class AecDumpAgentImpl : public mojom::AecDumpAgent {
private: private:
explicit AecDumpAgentImpl( explicit AecDumpAgentImpl(
Delegate* delegate, Delegate* delegate,
mojo::PendingReceiver<mojom::AecDumpAgent> receiver); mojo::PendingReceiver<blink::mojom::AecDumpAgent> receiver);
Delegate* delegate_; Delegate* delegate_;
mojo::Receiver<mojom::AecDumpAgent> receiver_{this}; mojo::Receiver<blink::mojom::AecDumpAgent> receiver_{this};
DISALLOW_COPY_AND_ASSIGN(AecDumpAgentImpl); DISALLOW_COPY_AND_ASSIGN(AecDumpAgentImpl);
}; };
......
...@@ -72,6 +72,7 @@ mojom("mojom_platform") { ...@@ -72,6 +72,7 @@ mojom("mojom_platform") {
"manifest/manifest.mojom", "manifest/manifest.mojom",
"manifest/manifest_manager.mojom", "manifest/manifest_manager.mojom",
"manifest/manifest_observer.mojom", "manifest/manifest_observer.mojom",
"mediastream/aec_dump.mojom",
"mediastream/media_devices.mojom", "mediastream/media_devices.mojom",
"mediastream/media_stream.mojom", "mediastream/media_stream.mojom",
"mime/mime_registry.mojom", "mime/mime_registry.mojom",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
module content.mojom; module blink.mojom;
import "mojo/public/mojom/base/file.mojom"; import "mojo/public/mojom/base/file.mojom";
......
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