Commit 6726f965 authored by Brandon Jones's avatar Brandon Jones Committed by Commit Bot

Added the 'light-estimation' XR feature descriptor

Bug: 1070819
Change-Id: Ia7d32b68864cea37788bc086520e51a0f828c7fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149892Reviewed-by: default avatarMike West <mkwst@chromium.org>
Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759738}
parent b98733b4
......@@ -71,6 +71,7 @@ void WebXRSessionTracker::ReportFeatureUsed(
break;
case XRSessionFeature::DOM_OVERLAY:
case XRSessionFeature::HIT_TEST:
case XRSessionFeature::LIGHT_ESTIMATION:
// Not recording metrics for these features currently.
// TODO(https://crbug.com/965729): Add metrics for the AR-related features
// that are enabled by default.
......@@ -106,6 +107,7 @@ void WebXRSessionTracker::SetFeatureRequest(
break;
case XRSessionFeature::DOM_OVERLAY:
case XRSessionFeature::HIT_TEST:
case XRSessionFeature::LIGHT_ESTIMATION:
// Not recording metrics for these features currently.
// TODO(https://crbug.com/965729): Add metrics for the AR-related features
// that are enabled by default.
......
......@@ -163,6 +163,7 @@ constexpr device::mojom::XRSessionFeature kARCoreDeviceFeatures[] = {
device::mojom::XRSessionFeature::REF_SPACE_LOCAL_FLOOR,
device::mojom::XRSessionFeature::REF_SPACE_UNBOUNDED,
device::mojom::XRSessionFeature::DOM_OVERLAY,
device::mojom::XRSessionFeature::LIGHT_ESTIMATION,
};
#if BUILDFLAG(ENABLE_OPENVR)
......
......@@ -59,6 +59,7 @@ enum XRSessionFeature {
// Experimental or not-yet-standardized feature names.
DOM_OVERLAY = 6,
HIT_TEST = 7,
LIGHT_ESTIMATION = 8,
};
// These values are persisted to logs. Entries should not be renumbered and
......
......@@ -295,6 +295,7 @@ void XRSession::MetricsReporter::ReportFeatureUsed(
break;
case XRSessionFeature::DOM_OVERLAY:
case XRSessionFeature::HIT_TEST:
case XRSessionFeature::LIGHT_ESTIMATION:
// Not recording metrics for these features currently.
break;
}
......
......@@ -123,6 +123,9 @@ base::Optional<device::mojom::XRSessionFeature> StringToXRSessionFeature(
return device::mojom::XRSessionFeature::HIT_TEST;
} else if (feature_string == "dom-overlay") {
return device::mojom::XRSessionFeature::DOM_OVERLAY;
} else if (RuntimeEnabledFeatures::WebXRIncubationsEnabled(doc) &&
feature_string == "light-estimation") {
return device::mojom::XRSessionFeature::LIGHT_ESTIMATION;
}
return base::nullopt;
......@@ -154,6 +157,8 @@ bool IsFeatureValidForMode(device::mojom::XRSessionFeature feature,
return false;
}
return true;
case device::mojom::XRSessionFeature::LIGHT_ESTIMATION:
return mode == device::mojom::blink::XRSessionMode::kImmersiveAr;
}
}
......@@ -171,6 +176,7 @@ bool HasRequiredFeaturePolicy(const Document* doc,
case device::mojom::XRSessionFeature::REF_SPACE_UNBOUNDED:
case device::mojom::XRSessionFeature::DOM_OVERLAY:
case device::mojom::XRSessionFeature::HIT_TEST:
case device::mojom::XRSessionFeature::LIGHT_ESTIMATION:
return doc->IsFeatureEnabled(mojom::blink::FeaturePolicyFeature::kWebXr,
ReportOptions::kReportOnFailure);
}
......
......@@ -214,6 +214,7 @@ class MockRuntime {
'unbounded': device.mojom.XRSessionFeature.REF_SPACE_UNBOUNDED,
'hit-test': device.mojom.XRSessionFeature.HIT_TEST,
'dom-overlay': device.mojom.XRSessionFeature.DOM_OVERLAY,
'light-estimation': device.mojom.XRSessionFeature.LIGHT_ESTIMATION,
};
static sessionModeToMojoMap = {
......
......@@ -128,6 +128,7 @@ const ALL_FEATURES = [
'unbounded',
'hit-test',
'dom-overlay',
'light-estimation',
];
const TRACKED_IMMERSIVE_DEVICE = {
......
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