Commit c25fd697 authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Remove "is_legacy_webvr" attribute

This change removes the "is_legacy_webvr" attribute from the mojom files
that used it, since this is now always false.  Any logic that depended
on it has been updated accordingly.

Note that the "IsLegacyWebVr" metric is still being logged to prevent
incompatiabilities with the data types while it is a value that is
needed for filters.

Bug: 1017872
Change-Id: Ie43c914a4bbac0c1b7beda02257865ac3e69f5ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1897857
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712854}
parent 4622e6e4
......@@ -220,10 +220,7 @@ GvrSchedulerDelegate::GetWebXrFrameTransportOptions(
// ClientWait.
if (gl::GLFence::IsGpuFenceSupported()) {
webxr_use_gpu_fence_ = true;
if (base::AndroidHardwareBufferCompat::IsSupportAvailable() &&
!options->is_legacy_webvr) {
// Currently, SharedBuffer mode is only supported for WebXR via
// XRWebGlDrawingBuffer, WebVR 1.1 doesn't use that.
if (base::AndroidHardwareBufferCompat::IsSupportAvailable()) {
webxr_use_shared_buffer_draw_ = true;
render_path = MetricsUtilAndroid::XRRenderPath::kSharedBuffer;
} else {
......
......@@ -239,8 +239,7 @@ void SessionMetricsHelper::RecordInlineSessionStart(size_t session_id) {
// replacement metrics once they are designed:
// result.first->second->ukm_entry()->SetStartAction(
// PresentationStartAction::kOther);
// WebVR does not come through this path as it does not have a separate
// concept of inline sessions.
// TODO(crbug.com/1021212): Remove IsLegacyWebVR when safe.
result.first->second->ukm_entry()->SetIsLegacyWebVR(false).SetMode(
static_cast<int64_t>(device::SessionMode::kInline));
}
......@@ -263,7 +262,6 @@ void SessionMetricsHelper::RecordInlineSessionStop(size_t session_id) {
void SessionMetricsHelper::RecordPresentationStartAction(
PresentationStartAction action,
const device::mojom::XRRuntimeSessionOptions& options) {
bool is_webvr = options.is_legacy_webvr;
auto xr_session_mode = ConvertRuntimeOptionsToSessionMode(options);
// TODO(https://crbug.com/965729): Ensure we correctly handle AR cases
......@@ -271,9 +269,9 @@ void SessionMetricsHelper::RecordPresentationStartAction(
if (!webxr_immersive_session_tracker_ ||
mode_ != Mode::kWebXrVrPresentation) {
pending_immersive_session_start_info_ =
PendingImmersiveSessionStartInfo{action, is_webvr, xr_session_mode};
PendingImmersiveSessionStartInfo{action, xr_session_mode};
} else {
LogPresentationStartAction(action, is_webvr, xr_session_mode);
LogPresentationStartAction(action, xr_session_mode);
}
}
......@@ -317,7 +315,6 @@ void SessionMetricsHelper::LogVrStartAction(VrStartAction action) {
void SessionMetricsHelper::LogPresentationStartAction(
PresentationStartAction action,
bool is_legacy_webvr,
device::SessionMode xr_session_mode) {
DCHECK(webxr_immersive_session_tracker_);
......@@ -327,8 +324,9 @@ void SessionMetricsHelper::LogPresentationStartAction(
// XR.WebXR.Session event. Remove this & change the below code with
// replacement metrics once they are designed:
// webxr_immersive_session_tracker_->ukm_entry()->SetStartAction(action);
// TODO(crbug.com/1021212): Remove IsLegacyWebVR when safe.
webxr_immersive_session_tracker_->ukm_entry()
->SetIsLegacyWebVR(is_legacy_webvr)
->SetIsLegacyWebVR(false)
.SetMode(static_cast<int64_t>(xr_session_mode));
}
......@@ -491,11 +489,10 @@ void SessionMetricsHelper::OnEnterPresentation() {
// TODO(https://crbug.com/967764): Can pending_immersive_session_start_info_
// be not set? What is the ordering of calls to RecordPresentationStartAction?
auto start_info = pending_immersive_session_start_info_.value_or(
PendingImmersiveSessionStartInfo{PresentationStartAction::kOther, false,
PendingImmersiveSessionStartInfo{PresentationStartAction::kOther,
device::SessionMode::kUnknown});
LogPresentationStartAction(start_info.action, start_info.is_legacy_webvr,
start_info.mode);
LogPresentationStartAction(start_info.action, start_info.mode);
}
void SessionMetricsHelper::OnExitPresentation() {
......@@ -655,9 +652,9 @@ void SessionMetricsHelper::DidFinishNavigation(
// replacement metrics once they are designed:
// webxr_immersive_session_tracker_->ukm_entry()->SetStartAction(
// pending_immersive_session_start_info_->action);
// TODO(crbug.com/1021212): Remove IsLegacyWebVR when safe.
webxr_immersive_session_tracker_->ukm_entry()
->SetIsLegacyWebVR(
pending_immersive_session_start_info_->is_legacy_webvr)
->SetIsLegacyWebVR(false)
.SetMode(static_cast<int64_t>(
pending_immersive_session_start_info_->mode));
pending_immersive_session_start_info_ = base::nullopt;
......
......@@ -129,6 +129,8 @@ class VR_BASE_EXPORT SessionMetricsHelper
~SessionMetricsHelper() override;
// Despite the name, which may suggest WebVR 1.1, both of these are *also*
// used for and crucial to, WebXr metrics.
void SetWebVREnabled(bool is_webvr_presenting);
void SetVRActive(bool is_vr_enabled);
void RecordVoiceSearchStarted();
......@@ -154,7 +156,6 @@ class VR_BASE_EXPORT SessionMetricsHelper
struct PendingImmersiveSessionStartInfo {
PresentationStartAction action = PresentationStartAction::kOther;
bool is_legacy_webvr = false;
device::SessionMode mode = device::SessionMode::kUnknown;
};
......@@ -175,7 +176,6 @@ class VR_BASE_EXPORT SessionMetricsHelper
void LogVrStartAction(VrStartAction action);
void LogPresentationStartAction(PresentationStartAction action,
bool is_web_vr,
device::SessionMode xr_session_mode);
void OnEnterAnyVr();
......
......@@ -55,7 +55,6 @@ device::mojom::XRRuntimeSessionOptionsPtr GetRuntimeOptions(
device::mojom::XRRuntimeSessionOptions::New();
runtime_options->immersive = options->immersive;
runtime_options->environment_integration = options->environment_integration;
runtime_options->is_legacy_webvr = options->is_legacy_webvr;
return runtime_options;
}
......@@ -393,14 +392,6 @@ void VRServiceImpl::ShowConsentPrompt(
DCHECK(!options->environment_integration);
#endif
// WebVR did not require permissions.
// TODO(crbug.com/968221): Address privacy requirements for inline sessions
if (options->is_legacy_webvr) {
DoRequestSession(std::move(options), std::move(callback), runtime,
std::move(requested_features));
return;
}
XrConsentPromptLevel consent_level =
GetRequiredConsentLevel(options->immersive, runtime, requested_features);
......
......@@ -56,11 +56,6 @@ struct XRRuntimeSessionOptions {
// module install UI in the browser process before calling out to devices.
int32 render_process_id;
int32 render_frame_id;
// This flag ensures that render paths that are only supported in WebXR are
// not used for WebVR 1.1. It is also used for metrics to distinguish between
// WebVR and WebXR APIs.
bool is_legacy_webvr;
};
// An XRRuntime may live in the browser process or a utility process. The
......
......@@ -70,11 +70,6 @@ struct XRSessionOptions {
// the feature will not be added to the enabled_features set on the XRSession
// struct that is returned.
array<XRSessionFeature> optional_features;
// This flag ensures that render paths that are only supported in WebXR are
// not used for WebVR 1.1. It is also used for metrics to distinguish between
// WebVR and WebXR APIs.
bool is_legacy_webvr;
};
// This structure contains all the mojo interfaces for different kinds of
......
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