Commit f4e57b20 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

Migrate references of device::mojom::XRInputSourceButtonListener

Convert the remaining bits in both the implementation and clients from the
browser and renderer processes for the XRInputSourceButtonListener
interface.

Bug: 955171, 978694
Change-Id: I2647b973b9784061918030bd2fb5f10e04b98212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844995Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#706397}
parent c4da0d6f
......@@ -631,7 +631,7 @@ void ArCoreGl::GetEnvironmentIntegrationProvider(
}
void ArCoreGl::SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo) {
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>) {
// Input eventing is not supported. This call should not
// be made on this device.
mojo::ReportBadMessage("Input eventing is not supported.");
......
......@@ -19,6 +19,7 @@
#include "device/vr/public/mojom/vr_service.mojom.h"
#include "device/vr/util/fps_meter.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
......@@ -89,7 +90,8 @@ class ArCoreGl : public mojom::XRFrameDataProvider,
mojom::XREnvironmentIntegrationProviderAssociatedRequest
environment_provider) override;
void SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo) override;
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>)
override;
// XRPresentationProvider
void SubmitFrameMissing(int16_t frame_index, const gpu::SyncToken&) override;
......
......@@ -1325,7 +1325,7 @@ void GvrSchedulerDelegate::GetEnvironmentIntegrationProvider(
}
void GvrSchedulerDelegate::SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo) {
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>) {
// Input eventing is not supported. This call should not
// be made on this device.
mojo::ReportBadMessage("Input eventing is not supported.");
......
......@@ -20,6 +20,7 @@
#include "chrome/browser/vr/base_scheduler_delegate.h"
#include "device/vr/public/mojom/vr_service.mojom.h"
#include "device/vr/util/sliding_average.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "ui/gfx/transform.h"
......@@ -142,7 +143,8 @@ class GvrSchedulerDelegate : public BaseSchedulerDelegate,
device::mojom::XREnvironmentIntegrationProviderAssociatedRequest
environment_provider) override;
void SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo) override;
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>)
override;
// XRPresentationProvider
void SubmitFrameMissing(int16_t frame_index, const gpu::SyncToken&) override;
......
......@@ -52,7 +52,7 @@ void VROrientationSession::GetEnvironmentIntegrationProvider(
}
void VROrientationSession::SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo) {
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>) {
// Input eventing is not supported. This call should not
// be made on this device.
mojo::ReportBadMessage("Input eventing is not supported.");
......
......@@ -13,7 +13,7 @@
#include "device/vr/public/mojom/vr_service.mojom.h"
#include "device/vr/vr_device.h"
#include "device/vr/vr_export.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "ui/display/display.h"
......@@ -39,7 +39,8 @@ class DEVICE_VR_EXPORT VROrientationSession
mojom::XREnvironmentIntegrationProviderAssociatedRequest
environment_provider) override;
void SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo) override;
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>)
override;
// Accessible to tests.
protected:
......
......@@ -604,7 +604,7 @@ interface XRFrameDataProvider {
GetEnvironmentIntegrationProvider(
associated XREnvironmentIntegrationProvider& environment_provider);
SetInputSourceButtonListener(
associated XRInputSourceButtonListener? event_listener);
pending_associated_remote<XRInputSourceButtonListener>? event_listener);
};
// Provides the necessary functionality for sending frames to a headset.
......
......@@ -138,7 +138,7 @@ void XRCompositorCommon::CleanUp() {
frame_data_receiver_.reset();
gamepad_provider_receiver_.reset();
overlay_receiver_.reset();
input_event_listener_ = nullptr;
input_event_listener_.reset();
StopRuntime();
}
......@@ -381,10 +381,11 @@ void XRCompositorCommon::GetFrameData(
}
void XRCompositorCommon::SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo
input_listener_info) {
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>
input_listener_remote) {
DCHECK(UsesInputEventing());
input_event_listener_.Bind(std::move(input_listener_info));
input_event_listener_.reset();
input_event_listener_.Bind(std::move(input_listener_remote));
}
void XRCompositorCommon::GetControllerDataAndSendFrameData(
......
......@@ -13,6 +13,8 @@
#include "device/vr/util/fps_meter.h"
#include "device/vr/util/sliding_average.h"
#include "device/vr/vr_device.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
......@@ -66,8 +68,8 @@ class XRCompositorCommon : public base::Thread,
void GetFrameData(mojom::XRFrameDataRequestOptionsPtr options,
XRFrameDataProvider::GetFrameDataCallback callback) final;
void SetInputSourceButtonListener(
device::mojom::XRInputSourceButtonListenerAssociatedPtrInfo
input_listener_info) override;
mojo::PendingAssociatedRemote<device::mojom::XRInputSourceButtonListener>
input_listener_remote) override;
void GetControllerDataAndSendFrameData(
XRFrameDataProvider::GetFrameDataCallback callback,
mojom::XRFrameDataPtr frame_data);
......@@ -90,7 +92,8 @@ class XRCompositorCommon : public base::Thread,
// Allow derived classes to call methods on the main thread.
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
mojom::XRInputSourceButtonListenerAssociatedPtr input_event_listener_;
mojo::AssociatedRemote<mojom::XRInputSourceButtonListener>
input_event_listener_;
private:
// base::Thread overrides:
......
......@@ -172,7 +172,6 @@ XRSession::XRSession(
enabled_features_(std::move(enabled_features)),
input_sources_(MakeGarbageCollected<XRInputSourceArray>()),
client_receiver_(this, std::move(client_receiver)),
input_binding_(this),
callback_collection_(
MakeGarbageCollected<XRFrameRequestCallbackCollection>(
xr_->GetExecutionContext())),
......@@ -236,13 +235,10 @@ const AtomicString& XRSession::InterfaceName() const {
return event_target_names::kXRSession;
}
device::mojom::blink::XRInputSourceButtonListenerAssociatedPtrInfo
mojo::PendingAssociatedRemote<device::mojom::blink::XRInputSourceButtonListener>
XRSession::GetInputClickListener() {
DCHECK(!input_binding_);
device::mojom::blink::XRInputSourceButtonListenerAssociatedPtrInfo
input_listener;
input_binding_.Bind(MakeRequest(&input_listener));
return input_listener;
DCHECK(!input_receiver_.is_bound());
return input_receiver_.BindNewEndpointAndPassRemote();
}
void XRSession::updateRenderState(XRRenderStateInit* init,
......
......@@ -7,7 +7,8 @@
#include "base/containers/span.h"
#include "device/vr/public/mojom/vr_service.mojom-blink.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
......@@ -186,7 +187,8 @@ class XRSession final
return display_info_;
}
device::mojom::blink::XRInputSourceButtonListenerAssociatedPtrInfo
mojo::PendingAssociatedRemote<
device::mojom::blink::XRInputSourceButtonListener>
GetInputClickListener();
bool EmulatedPosition() const {
......@@ -348,8 +350,8 @@ class XRSession final
device::mojom::blink::VRDisplayInfoPtr display_info_;
mojo::Receiver<device::mojom::blink::XRSessionClient> client_receiver_;
mojo::AssociatedBinding<device::mojom::blink::XRInputSourceButtonListener>
input_binding_;
mojo::AssociatedReceiver<device::mojom::blink::XRInputSourceButtonListener>
input_receiver_{this};
Member<XRFrameRequestCallbackCollection> callback_collection_;
// Viewer pose in mojo space.
......
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