Commit 084c8d81 authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Remove GetImmersiveVrDisplayInfo and associated methods

GetImmersiveVrDisplayInfo (and the EnsureInitialized call it triggered)
were WebVr compatibility methods that, with the removal of webvr, were
no longer called.

Bug: 1017872
Change-Id: Ia4b5350d4a2fea47e155ae9ddfa0cb125bf979c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900134
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarPiotr Bialecki <bialpio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713939}
parent 1b0f9d85
......@@ -390,14 +390,6 @@ void BrowserXRRuntime::OnVisibilityStateChanged(
}
}
void BrowserXRRuntime::OnInitialized() {
DVLOG(2) << __func__;
for (auto& callback : pending_initialization_callbacks_) {
std::move(callback).Run(display_info_.Clone());
}
pending_initialization_callbacks_.clear();
}
void BrowserXRRuntime::OnServiceAdded(VRServiceImpl* service) {
DVLOG(2) << __func__ << ": id=" << id_;
services_.insert(service);
......@@ -488,19 +480,4 @@ void BrowserXRRuntime::OnImmersiveSessionError() {
StopImmersiveSession(base::DoNothing());
}
void BrowserXRRuntime::InitializeAndGetDisplayInfo(
content::RenderFrameHost* render_frame_host,
device::mojom::VRService::GetImmersiveVRDisplayInfoCallback callback) {
DVLOG(2) << __func__ << ": id=" << id_;
device::mojom::VRDisplayInfoPtr device_info = GetVRDisplayInfo();
if (device_info) {
std::move(callback).Run(std::move(device_info));
return;
}
pending_initialization_callbacks_.push_back(std::move(callback));
runtime_->EnsureInitialized(
base::BindOnce(&BrowserXRRuntime::OnInitialized, base::Unretained(this)));
}
} // namespace vr
......@@ -83,9 +83,6 @@ class BrowserXRRuntime : public device::mojom::XRRuntimeEventListener {
device::mojom::VRDisplayInfoPtr GetVRDisplayInfo() {
return display_info_.Clone();
}
void InitializeAndGetDisplayInfo(
content::RenderFrameHost* render_frame_host,
device::mojom::VRService::GetImmersiveVRDisplayInfoCallback callback);
// Methods called to support metrics/overlays on Windows.
void AddObserver(BrowserXRRuntimeObserver* observer) {
......@@ -114,7 +111,6 @@ class BrowserXRRuntime : public device::mojom::XRRuntimeEventListener {
mojo::PendingRemote<device::mojom::XRSessionController>
immersive_session_controller);
void OnImmersiveSessionError();
void OnInitialized();
device::mojom::XRDeviceId id_;
mojo::Remote<device::mojom::XRRuntime> runtime_;
......@@ -128,8 +124,6 @@ class BrowserXRRuntime : public device::mojom::XRRuntimeEventListener {
mojo::AssociatedReceiver<device::mojom::XRRuntimeEventListener> receiver_{
this};
std::vector<device::mojom::VRService::GetImmersiveVRDisplayInfoCallback>
pending_initialization_callbacks_;
base::ObserverList<BrowserXRRuntimeObserver> observers_;
......
......@@ -605,26 +605,6 @@ void VRServiceImpl::SetFramesThrottled(bool throttled) {
}
}
void VRServiceImpl::GetImmersiveVRDisplayInfo(
device::mojom::VRService::GetImmersiveVRDisplayInfoCallback callback) {
if (!initialization_complete_) {
pending_requests_.push_back(
base::BindOnce(&VRServiceImpl::GetImmersiveVRDisplayInfo,
base::Unretained(this), std::move(callback)));
return;
}
BrowserXRRuntime* immersive_runtime =
runtime_manager_->GetImmersiveVrRuntime();
if (immersive_runtime) {
immersive_runtime->InitializeAndGetDisplayInfo(render_frame_host_,
std::move(callback));
return;
}
std::move(callback).Run(nullptr);
}
void VRServiceImpl::OnExitPresent() {
DVLOG(2) << __func__;
......
......@@ -65,10 +65,6 @@ class VR_EXPORT VRServiceImpl : public device::mojom::VRService,
device::mojom::VRService::SupportsSessionCallback callback) override;
void ExitPresent(ExitPresentCallback on_exited) override;
void SetFramesThrottled(bool throttled) override;
// device::mojom::VRService WebVR compatibility functions
void GetImmersiveVRDisplayInfo(
device::mojom::VRService::GetImmersiveVRDisplayInfoCallback callback)
override;
void InitializationComplete();
......@@ -81,7 +77,6 @@ class VR_EXPORT VRServiceImpl : public device::mojom::VRService,
void OnExitPresent();
void OnVisibilityStateChanged(
device::mojom::XRVisibilityState visibility_state);
bool InFocusedFrame() { return in_focused_frame_; }
void OnDisplayInfoChanged();
void RuntimesChanged();
......
......@@ -261,12 +261,6 @@ void GvrDevice::ResumeTracking() {
}
}
void GvrDevice::EnsureInitialized(EnsureInitializedCallback callback) {
Init(base::BindOnce([](EnsureInitializedCallback callback,
bool) { std::move(callback).Run(); },
std::move(callback)));
}
GvrDelegateProvider* GvrDevice::GetGvrDelegateProvider() {
// GvrDelegateProviderFactory::Create() may return a different
// pointer each time. Do not cache it.
......
......@@ -31,7 +31,6 @@ class DEVICE_VR_EXPORT GvrDevice : public VRDeviceBase,
mojom::XRRuntime::RequestSessionCallback callback) override;
void PauseTracking() override;
void ResumeTracking() override;
void EnsureInitialized(EnsureInitializedCallback callback) override;
void ShutdownSession(mojom::XRRuntime::ShutdownSessionCallback) override;
void OnDisplayConfigurationChanged(
......
......@@ -163,11 +163,6 @@ void OculusDevice::RequestSession(
outstanding_session_requests_count_++;
}
void OculusDevice::EnsureInitialized(EnsureInitializedCallback callback) {
EnsureValidDisplayInfo();
std::move(callback).Run();
}
bool OculusDevice::EnsureValidDisplayInfo() {
// Ensure we have had a valid display_info set at least once.
if (!have_real_display_info_) {
......
......@@ -35,7 +35,6 @@ class DEVICE_VR_EXPORT OculusDevice
void RequestSession(
mojom::XRRuntimeSessionOptionsPtr options,
mojom::XRRuntime::RequestSessionCallback callback) override;
void EnsureInitialized(EnsureInitializedCallback callback) override;
void OnRequestSessionResult(mojom::XRRuntime::RequestSessionCallback callback,
bool result,
mojom::XRSessionPtr session);
......
......@@ -191,11 +191,6 @@ void OpenVRDevice::RequestSession(
outstanding_session_requests_count_++;
}
void OpenVRDevice::EnsureInitialized(EnsureInitializedCallback callback) {
EnsureValidDisplayInfo();
std::move(callback).Run();
}
bool OpenVRDevice::EnsureValidDisplayInfo() {
// Ensure we have had a valid display_info set at least once.
if (!have_real_display_info_) {
......
......@@ -38,7 +38,6 @@ class DEVICE_VR_EXPORT OpenVRDevice
void RequestSession(
mojom::XRRuntimeSessionOptionsPtr options,
mojom::XRRuntime::RequestSessionCallback callback) override;
void EnsureInitialized(EnsureInitializedCallback callback) override;
void OnPollingEvents();
......
......@@ -73,14 +73,6 @@ interface XRRuntime {
pending_associated_remote<XRRuntimeEventListener> listener) =>
(VRDisplayInfo? display_info);
// Ensure that the runtime has installed most prerequisites, and is ready to
// start. May result in updated display info being sent to registered
// listeners. RequestSession will fail if this hasn't been called.
// NOTE: When crbug.com/980000 is resolved, GvrDevice::EnsureInitialized
// won't install GVR runtime; it will be installed in
// GvrDevice::RequestSession().
EnsureInitialized() => ();
SetInlinePosesEnabled(bool enable);
};
......
......@@ -483,12 +483,6 @@ interface VRService {
RequestSession(XRSessionOptions options) => (RequestSessionResult result);
SupportsSession(XRSessionOptions options) => (bool supports_session);
// WebVR 1.1 functionality compatibility method. Returns VRDisplayInfo for an
// immersive session if immersive is supported. If (and only if) immersive is
// not supported, will return a nullptr. This call might cause device specific
// UI to appear.
GetImmersiveVRDisplayInfo() => (VRDisplayInfo? info);
// Shuts down an active immersive session. The callback is triggered
// once teardown is complete and the system is again in a state where
// a new immersive session could be started.
......
......@@ -80,10 +80,6 @@ mojo::PendingRemote<mojom::XRRuntime> VRDeviceBase::BindXRRuntime() {
return runtime_receiver_.BindNewPipeAndPassRemote();
}
void VRDeviceBase::EnsureInitialized(EnsureInitializedCallback callback) {
std::move(callback).Run();
}
void VRDeviceBase::SetInlinePosesEnabled(bool enable) {
inline_poses_enabled_ = enable;
}
......
......@@ -33,7 +33,6 @@ class DEVICE_VR_EXPORT VRDeviceBase : public mojom::XRRuntime {
void ListenToDeviceChanges(
mojo::PendingAssociatedRemote<mojom::XRRuntimeEventListener> listener,
mojom::XRRuntime::ListenToDeviceChangesCallback callback) final;
void EnsureInitialized(EnsureInitializedCallback callback) override;
void SetInlinePosesEnabled(bool enable) override;
void ShutdownSession(mojom::XRRuntime::ShutdownSessionCallback) override;
......
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