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