Commit 0060cccc authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Convert XRRuntimeEventListener to new Mojo types

This CL converts mojo::AssociatedBinding<XRRuntimeEventListener>
that is left only in BrowserXRRuntime class to the new Mojo type.

Bug: 955171
Change-Id: I114458055b27ffd306e357bad1d01cdd1e303238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849736
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705398}
parent a1bf343c
......@@ -224,15 +224,11 @@ BrowserXRRuntime::BrowserXRRuntime(device::mojom::XRDeviceId id,
device::mojom::VRDisplayInfoPtr display_info)
: id_(id),
runtime_(std::move(runtime)),
display_info_(ValidateVRDisplayInfo(display_info.get(), id)),
binding_(this) {
device::mojom::XRRuntimeEventListenerAssociatedPtr listener;
binding_.Bind(mojo::MakeRequest(&listener));
display_info_(ValidateVRDisplayInfo(display_info.get(), id)) {
// Unretained is safe because we are calling through an InterfacePtr we own,
// so we won't be called after runtime_ is destroyed.
runtime_->ListenToDeviceChanges(
listener.PassInterface(),
receiver_.BindNewEndpointAndPassRemote(),
base::BindOnce(&BrowserXRRuntime::OnDisplayInfoChanged,
base::Unretained(this)));
}
......
......@@ -14,7 +14,7 @@
#include "device/vr/public/mojom/isolated_xr_service.mojom.h"
#include "device/vr/public/mojom/vr_service.mojom.h"
#include "device/vr/vr_device.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
......@@ -129,7 +129,8 @@ class BrowserXRRuntime : public device::mojom::XRRuntimeEventListener {
VRServiceImpl* listening_for_activation_service_ = nullptr;
VRServiceImpl* presenting_service_ = nullptr;
mojo::AssociatedBinding<device::mojom::XRRuntimeEventListener> binding_;
mojo::AssociatedReceiver<device::mojom::XRRuntimeEventListener> receiver_{
this};
std::vector<device::mojom::VRService::GetImmersiveVRDisplayInfoCallback>
pending_initialization_callbacks_;
......
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