Commit e677d511 authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Clean up old Mojo types for interfaces from remoting.mojom

This CL cleans up old Mojo types for mojom::Remoter,
mojom::RemotingSource, and mojom::RemoterFactory using
Remote, Receiver, PendingReceiver.

Bug: 955171
Change-Id: I3b06bf38ceae5e357d7c6de615616302dad7bfce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1892990
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712448}
parent c52cf1af
......@@ -21,21 +21,13 @@
#include "content/public/test/browser_task_environment.h"
#include "media/mojo/mojom/mirror_service_remoting.mojom.h"
#include "media/mojo/mojom/remoting.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
using media::mojom::RemoterPtr;
using media::mojom::RemoterRequest;
using media::mojom::RemotingSinkMetadata;
using media::mojom::RemotingSinkMetadataPtr;
using media::mojom::RemotingSourcePtr;
using media::mojom::RemotingSourceRequest;
using media::mojom::RemotingStartFailReason;
using media::mojom::RemotingStopReason;
......@@ -106,7 +98,7 @@ class MockRemotingSource : public media::mojom::RemotingSource {
MockRemotingSource() {}
~MockRemotingSource() final {}
void Bind(mojo::PendingReceiver<RemotingSource> receiver) {
void Bind(mojo::PendingReceiver<media::mojom::RemotingSource> receiver) {
receiver_.Bind(std::move(receiver));
}
......@@ -141,7 +133,7 @@ class MockMediaRemoter final : public media::mojom::MirrorServiceRemoter,
explicit MockMediaRemoter(CastRemotingConnector* connector) {
connector->ConnectWithMediaRemoter(receiver_.BindNewPipeAndPassRemote(),
mojo::MakeRequest(&source_));
source_.BindNewPipeAndPassReceiver());
}
~MockMediaRemoter() final {}
......@@ -221,7 +213,7 @@ class MockMediaRemoter final : public media::mojom::MirrorServiceRemoter,
mojo::Remote<media::mojom::MirrorServiceRemotingSource> deprecated_source_;
mojo::Receiver<media::mojom::Remoter> receiver_{this};
RemotingSourcePtr source_;
mojo::Remote<media::mojom::RemotingSource> source_;
};
} // namespace
......
......@@ -10,7 +10,6 @@
#include "media/cast/cast_config.h"
#include "media/mojo/mojom/remoting.mojom.h"
#include "media/mojo/mojom/remoting_common.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
......
......@@ -12,9 +12,8 @@
#include "components/mirroring/service/message_dispatcher.h"
#include "components/mirroring/service/mirror_settings.h"
#include "media/cast/cast_environment.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -32,11 +31,11 @@ namespace {
class MockRemotingSource final : public media::mojom::RemotingSource {
public:
MockRemotingSource() : binding_(this) {}
~MockRemotingSource() override {}
MockRemotingSource() = default;
~MockRemotingSource() override = default;
void Bind(media::mojom::RemotingSourceRequest request) {
binding_.Bind(std::move(request));
void Bind(mojo::PendingReceiver<media::mojom::RemotingSource> receiver) {
receiver_.Bind(std::move(receiver));
}
MOCK_METHOD0(OnSinkGone, void());
......@@ -51,7 +50,7 @@ class MockRemotingSource final : public media::mojom::RemotingSource {
}
private:
mojo::Binding<media::mojom::RemotingSource> binding_;
mojo::Receiver<media::mojom::RemotingSource> receiver_{this};
};
RemotingSinkMetadata DefaultSinkMetadata() {
......
......@@ -178,7 +178,6 @@
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/cookies/cookie_constants.h"
......@@ -382,12 +381,13 @@ class RemoterFactoryImpl final : public media::mojom::RemoterFactory {
RemoterFactoryImpl(int process_id, int routing_id)
: process_id_(process_id), routing_id_(routing_id) {}
static void Bind(int process_id,
int routing_id,
media::mojom::RemoterFactoryRequest request) {
mojo::MakeStrongBinding(
static void Bind(
int process_id,
int routing_id,
mojo::PendingReceiver<media::mojom::RemoterFactory> receiver) {
mojo::MakeSelfOwnedReceiver(
std::make_unique<RemoterFactoryImpl>(process_id, routing_id),
std::move(request));
std::move(receiver));
}
private:
......
......@@ -619,7 +619,8 @@ media::DecoderFactory* MediaFactory::GetDecoderFactory() {
media::mojom::RemoterFactory* MediaFactory::GetRemoterFactory() {
if (!remoter_factory_) {
DCHECK(remote_interfaces_);
remote_interfaces_->GetInterface(&remoter_factory_);
remote_interfaces_->GetInterface(
remoter_factory_.BindNewPipeAndPassReceiver());
}
return remoter_factory_.get();
}
......
......@@ -17,6 +17,7 @@
#include "media/media_buildflags.h"
#include "media/mojo/buildflags.h"
#include "media/mojo/mojom/remoting.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/platform/web_media_player_source.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_set_sink_id_callbacks.h"
......@@ -190,9 +191,9 @@ class MediaFactory {
web_encrypted_media_client_;
#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
// Lazy-bound pointer to the RemoterFactory service in the browser
// Lazy-bound remote for the RemoterFactory service in the browser
// process. Always use the GetRemoterFactory() accessor instead of this.
media::mojom::RemoterFactoryPtr remoter_factory_;
mojo::Remote<media::mojom::RemoterFactory> remoter_factory_;
#endif
};
......
......@@ -19,6 +19,7 @@
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
namespace media {
......@@ -126,7 +127,7 @@ class TestRemoter final : public mojom::Remoter {
}
private:
mojom::RemotingSourcePtr source_;
mojo::Remote<mojom::RemotingSource> source_;
const SendMessageToSinkCallback send_message_to_sink_cb_;
const TestStreamSender::SendFrameToSinkCallback send_frame_to_sink_cb_;
std::unique_ptr<TestStreamSender> audio_stream_sender_;
......
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