Commit 8a7f8e2f authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Convert MediaCaps to new Mojo types

This CL converts MediaCapsRequest and MediaCapsPtr to
new Mojo types.

Bug: 955171
Change-Id: I8fd9b87f2027b5abc3ffbfda942894eaf19e5865
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1788430
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695534}
parent b7d50c6e
......@@ -737,7 +737,7 @@ void CastContentBrowserClient::ExposeInterfacesToRenderer(
blink::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* render_process_host) {
registry->AddInterface(
base::Bind(&media::MediaCapsImpl::AddBinding,
base::Bind(&media::MediaCapsImpl::AddReceiver,
base::Unretained(cast_browser_main_parts_->media_caps())),
base::ThreadTaskRunnerHandle::Get());
......
......@@ -38,9 +38,9 @@ void MediaCapsImpl::Initialize() {
supported_codec_finder.FindSupportedCodecProfileLevels(this);
}
void MediaCapsImpl::AddBinding(
mojom::MediaCapsRequest request) {
bindings_.AddBinding(this, std::move(request));
void MediaCapsImpl::AddReceiver(
mojo::PendingReceiver<mojom::MediaCaps> receiver) {
receivers_.Add(this, std::move(receiver));
}
void MediaCapsImpl::ScreenResolutionChanged(unsigned width, unsigned height) {
......
......@@ -9,8 +9,8 @@
#include "base/macros.h"
#include "chromecast/common/mojom/media_caps.mojom.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/interface_ptr_set.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "ui/gfx/geometry/size.h"
namespace chromecast {
......@@ -24,7 +24,7 @@ class MediaCapsImpl : public mojom::MediaCaps {
~MediaCapsImpl() override;
void Initialize();
void AddBinding(mojom::MediaCapsRequest request);
void AddReceiver(mojo::PendingReceiver<mojom::MediaCaps> receiver);
void ScreenResolutionChanged(unsigned width, unsigned height);
void ScreenInfoChanged(int hdcp_version,
......@@ -51,7 +51,7 @@ class MediaCapsImpl : public mojom::MediaCaps {
gfx::Size screen_resolution_;
std::vector<CodecProfileLevel> codec_profile_levels_;
mojo::InterfacePtrSet<mojom::MediaCapsObserver> observers_;
mojo::BindingSet<mojom::MediaCaps> bindings_;
mojo::ReceiverSet<mojom::MediaCaps> receivers_;
DISALLOW_COPY_AND_ASSIGN(MediaCapsImpl);
};
......
......@@ -99,8 +99,8 @@ CastContentRendererClient::~CastContentRendererClient() = default;
void CastContentRendererClient::RenderThreadStarted() {
// Register as observer for media capabilities
content::RenderThread* thread = content::RenderThread::Get();
media::mojom::MediaCapsPtr media_caps;
thread->BindHostReceiver(mojo::MakeRequest(&media_caps));
mojo::Remote<media::mojom::MediaCaps> media_caps;
thread->BindHostReceiver(media_caps.BindNewPipeAndPassReceiver());
media::mojom::MediaCapsObserverPtr proxy;
media_caps_observer_.reset(
new media::MediaCapsObserverImpl(&proxy, supported_profiles_.get()));
......
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